/* ===== Home View ===== */
#home-view {
  padding-top: 0;
  min-height: calc(100vh - 65px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.grid-types-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 48px;
  margin-bottom: 60px;
}

.grid-type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  cursor: pointer;
}

.grid-type-box {
  width: 200px;
  height: 200px;
  background: #000;
  border-radius: 24px;
  box-shadow: 0 16px 40px -8px rgba(0,0,0,0.35), 0 10px 16px -8px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.grid-type-card:hover .grid-type-box {
  transform: scale(1.06) rotate(-2deg);
  box-shadow: 0 20px 50px -10px rgba(0,0,0,0.45), 0 12px 20px -10px rgba(0,0,0,0.25);
}

.grid-type-box svg {
  width: 100%;
  height: 100%;
}

.grid-type-label {
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-title-section { text-align: center; }

.home-title {
  font-size: 60px;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.04em;
}

.home-subtitle {
  font-size: 24px;
  font-weight: 500;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.home-actions {
  margin-top: 48px;
  display: flex;
  justify-content: center;
  gap: 16px;
}

.pill-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 32px;
  background: #fff;
  border-radius: 9999px;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  font-weight: 500;
  transition: box-shadow 0.2s;
}
.pill-btn:hover {
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
}

.btn-emoji { font-size: 18px; }

/* ===== Editor View ===== */
#editor-view { padding-top: 48px; }

.editor-title { text-align: center; margin-bottom: 48px; }
.editor-title h2 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.editor-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: start;
}

@media (min-width: 1024px) {
  .editor-layout {
    grid-template-columns: 7fr 5fr;
  }
}

.editor-left {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.canvas-wrapper {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
  padding: 32px;
  border: 1px solid rgba(0,0,0,0.05);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.grid-canvas {
  display: grid;
  background: #f8f9fa;
  border: 1px solid #e5e7eb;
  padding: 1px;
  width: 100%;
  height: 100%;
  max-width: 500px;
  max-height: 500px;
  user-select: none;
  -webkit-user-select: none;
}

.grid-cell {
  cursor: pointer;
  transition: background-color 0.15s, transform 0.15s, box-shadow 0.15s;
  background: #fff;
  border: 1px solid #e5e7eb;
}
.grid-cell:hover { background: #f0f0f0; }
.grid-cell.filled {
  background: #2d3436;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transform: scale(1.02);
}

/* Shape-specific cell styles */
.grid-cell-triangle {
  margin: -1px 0;
}
.grid-cell-line {
  height: 40%;
  align-self: center;
}

.canvas-info {
  position: absolute;
  bottom: 16px;
  left: 16px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #9ca3af;
  font-family: 'Courier New', monospace;
}

.canvas-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: #fff;
  border-radius: 9999px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  border: 1px solid #e5e7eb;
  font-size: 14px;
  font-weight: 500;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.action-btn:hover {
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  border-color: #d1d5db;
}
.action-btn-danger { color: #ef4444; }

/* ===== Control Card ===== */
.editor-right {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.control-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  border: 1px solid rgba(0,0,0,0.05);
  padding: 24px;
}

.control-card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.controls-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}
@media (min-width: 768px) {
  .controls-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.control-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #9ca3af;
}

/* ===== Sliders ===== */
.sliders-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.slider-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slider-label {
  font-size: 14px;
  font-weight: 500;
  color: #4b5563;
}

.slider-value {
  font-size: 12px;
  font-family: 'Courier New', monospace;
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 4px;
  color: #6b7280;
}

.slider {
  width: 100%;
  height: 6px;
  background: #e5e7eb;
  border-radius: 8px;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #000;
  cursor: pointer;
  border: none;
}
.slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #000;
  cursor: pointer;
  border: none;
}

/* ===== Presets ===== */
.presets-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.preset-btn {
  aspect-ratio: 1 / 1;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.05);
  padding: 8px;
  transition: border-color 0.2s;
}
.preset-btn:hover { border-color: #d1d5db; }

.preset-inner {
  width: 100%;
  height: 100%;
}

.preset-grid-3x3 {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 2px;
  opacity: 0.4;
  transition: opacity 0.2s;
}
.preset-btn:hover .preset-grid-3x3 { opacity: 1; }

.preset-mini-cell {
  background: rgba(0,0,0,0.2);
  border-radius: 1px;
}
.preset-mini-cell.alt { background: rgba(0,0,0,0.6); }

.random-btn {
  grid-column: span 2;
  padding: 12px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.05);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: border-color 0.2s;
}
.random-btn:hover { border-color: #d1d5db; }

/* ===== Character Map ===== */
.char-map {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}

.char-btn {
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s, color 0.15s;
  position: relative;
  color: #9ca3af;
}
.char-btn:hover { background: #f3f4f6; }
.char-btn.active {
  background: #000;
  color: #fff;
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.2);
  transform: scale(1.1);
  z-index: 10;
}

.char-btn-label {
  font-size: 18px;
  font-weight: 700;
}

.char-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 4px;
  height: 4px;
  background: #3b82f6;
  border-radius: 50%;
}

/* ===== Download Font Button ===== */
.download-font-btn {
  width: 100%;
  padding: 16px;
  background: #2563eb;
  color: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(37,99,235,0.35);
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: background 0.2s;
}
.download-font-btn:hover { background: #1d4ed8; }
.download-font-btn:disabled {
  background: #60a5fa;
  cursor: not-allowed;
}
.download-font-btn svg { transition: transform 0.2s; }
.download-font-btn:not(:disabled):hover svg { transform: translateY(2px); }

/* ===== Spinner ===== */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.spin { animation: spin 1s linear infinite; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(50px);
  padding: 12px 24px;
  background: #000;
  color: #fff;
  border-radius: 9999px;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.25);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* ===== Responsive (app-specific) ===== */
@media (max-width: 767px) {
  .home-title { font-size: 36px; }
  .home-subtitle { font-size: 16px; }
}
