/* german.css - Styles for the German Numbers game (german-numbers.html)
   Reuses and harmonizes with style.css palette and layout. */

:root {
  --de-green: #00b894;
  --de-green-dark: #009e73;
  --de-green-bg: #e6fbf3;
  --de-blue: #0984e3;
  --de-blue-dark: #076bbb;
  --de-blue-bg: #f0f7ff;
  --de-und: #8395a7;
}

/* ---------- German Word Card ---------- */
.german-word-card {
  width: 100%;
  max-width: 760px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  border: 3px solid #e2ecf9;
  border-radius: 24px;
  padding: 20px 24px;
  box-shadow: 0 8px 24px rgba(9, 132, 227, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 6px 0 14px;
}

.german-word-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.german-word {
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-align: center;
  user-select: none;
}

.de-word-ones {
  color: var(--de-green);
  text-shadow: 0 2px 4px rgba(0, 184, 148, 0.22);
}

.de-word-und {
  color: var(--de-und);
  font-weight: 700;
  padding: 0 2px;
}

.de-word-tens {
  color: var(--de-blue);
  text-shadow: 0 2px 4px rgba(9, 132, 227, 0.22);
}

.btn-speak {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid #dfe6e9;
  background: #ffffff;
  color: var(--de-blue);
  font-size: 1.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.btn-speak:hover {
  transform: scale(1.08);
  border-color: var(--de-blue);
  background: var(--de-blue-bg);
}

.btn-speak:active {
  transform: scale(0.94);
}

.german-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 0.95rem;
  font-weight: 700;
}

.legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  line-height: 1.2;
}

.legend-pill.ones {
  background: var(--de-green-bg);
  color: var(--de-green-dark);
  border: 2px solid #a7f3d0;
}

.legend-pill.tens {
  background: var(--de-blue-bg);
  color: var(--de-blue-dark);
  border: 2px solid #bcdcff;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.ones { background: var(--de-green); }
.legend-dot.tens { background: var(--de-blue); }

/* ---------- Style Switcher ---------- */
.style-switcher-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: 4px 0 16px;
  padding: 6px 14px;
  background: #f8f9fa;
  border-radius: 18px;
}

.style-switcher-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--muted);
}

.style-toggle-group {
  display: inline-flex;
  background: #e9ecef;
  border-radius: 14px;
  padding: 4px;
  gap: 4px;
}

.style-toggle-btn {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 8px 16px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.style-toggle-btn:hover {
  color: var(--ink);
}

.style-toggle-btn.active {
  background: #ffffff;
  color: var(--purple);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

/* ---------- Interactive Builder Stage ---------- */
.builder-stage {
  display: flex;
  gap: 20px;
  width: 100%;
  max-width: 860px;
  align-items: stretch;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

/* Toolbox */
.toolbox {
  flex: 0 0 240px;
  min-width: 210px;
  background: #fafbfc;
  border: 2px dashed #dfe6e9;
  border-radius: 22px;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.toolbox-header {
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
  text-align: center;
}

.toolbox-item-card {
  width: 100%;
  background: #ffffff;
  border: 2px solid #eef2f5;
  border-radius: 18px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
}

.toolbox-preview-slot {
  min-height: 130px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  user-select: none;
  padding: 6px;
}

.toolbox-add-btn {
  font: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  min-height: 44px;
  padding: 8px 18px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  width: 88%;
  color: #ffffff;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

.toolbox-add-btn:hover {
  transform: translateY(-2px);
}

.toolbox-add-btn:active {
  transform: translateY(0);
}

.add-tens {
  background: linear-gradient(135deg, var(--de-blue), #38bdf8);
}

.add-ones {
  background: linear-gradient(135deg, var(--de-green), #00cec9);
}

.toolbox-tip {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  line-height: 1.35;
  padding: 0 6px;
}

/* Build Mat */
.build-mat {
  flex: 1 1 420px;
  background: #ffffff;
  border: 3px solid #dfe6e9;
  border-radius: 24px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.build-mat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 2px solid #f1f2f6;
}

.build-mat-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--ink);
}

.btn-clear-mat {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 14px;
  border: 2px solid #ffc9bf;
  border-radius: 12px;
  background: #fff3f0;
  color: var(--red);
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-clear-mat:hover {
  background: #ffe3dc;
  border-color: var(--soft-red);
}

.drop-columns {
  display: flex;
  gap: 14px;
  width: 100%;
}

.drop-col {
  flex: 1 1 0;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drop-col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 800;
}

.drop-col-header.tens { color: var(--de-blue); }
.drop-col-header.ones { color: var(--de-green-dark); }

.col-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
}

.col-badge.tens {
  background: var(--de-blue-bg);
  color: var(--de-blue-dark);
}

.col-badge.ones {
  background: var(--de-green-bg);
  color: var(--de-green-dark);
}

.drop-zone {
  flex: 1;
  min-height: 190px;
  border-radius: 18px;
  padding: 12px;
  position: relative;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
  display: flex;
  flex-direction: column;
}

.drop-zone.tens-zone {
  background: #f8fbff;
  border: 2px dashed #bcdcff;
}

.drop-zone.ones-zone {
  background: #f6fdfa;
  border: 2px dashed #a7f3d0;
}

.drop-zone.drag-hover {
  border-color: var(--purple);
  background: #f6f4ff;
  box-shadow: inset 0 0 0 3px rgba(108, 92, 231, 0.25);
  transform: scale(1.01);
}

.zone-empty-tip {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a0aec0;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
  padding: 16px;
  pointer-events: none;
  user-select: none;
}

.zone-items-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  height: 100%;
  align-content: flex-start;
  z-index: 2;
}

/* Mat Footer */
.build-mat-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 8px;
  border-top: 2px solid #f1f2f6;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--muted);
}

.total-summary b {
  font-size: 1.2rem;
  color: var(--purple);
}

.mat-action-tip {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ---------- Block Renderings (2 Options) ---------- */

/* Common Draggable / Placed Item Styles */
.block-item {
  cursor: pointer;
  position: relative;
  user-select: none;
  touch-action: none;
  transition: transform 0.16s ease, filter 0.16s ease;
  animation: popIn 0.24s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.block-item:hover {
  transform: scale(1.08);
  filter: brightness(1.08);
}

.block-item:active {
  transform: scale(0.92);
}

/* Placed item delete badge on hover */
.placed-block::after {
  content: '×';
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--soft-red);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  line-height: 17px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.placed-block:hover::after {
  opacity: 1;
}

/* 1. Classic Style: Rods (tens) & Cubes (ones) */
.style-classic .ten-block {
  width: 24px;
  height: 120px;
  border-radius: 6px;
  background: repeating-linear-gradient(to bottom, #ffb26b 0 10px, #e1873a 10px 12px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.16);
}

.style-classic .one-block {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: linear-gradient(135deg, #74b9ff, #0984e3);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.16);
}

.style-classic .tens-zone .zone-items-container {
  flex-direction: row;
  align-items: flex-end;
  gap: 8px;
}

.style-classic .ones-zone .zone-items-container {
  gap: 6px;
  max-width: 160px;
}

/* 2. Lines & Dots Style: Horizontal Blue Lines (tens) & Green Dots (ones) */
.style-lines-dots .ten-block {
  width: 100%;
  max-width: 130px;
  height: 18px;
  border-radius: 9px;
  background: repeating-linear-gradient(
    90deg,
    #0984e3 0 11px,
    #076bbb 11px 13px
  );
  box-shadow: 0 3px 8px rgba(9, 132, 227, 0.35);
}

.style-lines-dots .one-block {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #55efc4, #00b894);
  box-shadow: 0 3px 8px rgba(0, 184, 148, 0.4);
}

.style-lines-dots .tens-zone .zone-items-container {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.style-lines-dots .ones-zone .zone-items-container {
  gap: 10px;
  max-width: 170px;
}

/* Drag Ghost Avatar */
.drag-avatar {
  position: fixed;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%) scale(1.15);
  opacity: 0.92;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28) !important;
  cursor: grabbing;
}

/* ---------- Solution Breakdown Box ---------- */
.solution-breakdown {
  width: 100%;
  max-width: 680px;
  background: #f0fbf7;
  border: 3px solid #b8efdd;
  border-radius: 22px;
  padding: 16px 20px;
  margin: 10px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  animation: fadeInUp 0.32s ease;
}

.solution-breakdown.gone,
.gone {
  display: none !important;
}

.solution-breakdown.hint-mode {
  background: #fff8ee;
  border-color: var(--yellow);
}

.breakdown-heading {
  font-size: 1.25rem;
  font-weight: 800;
  color: #00795f;
}

.solution-breakdown.hint-mode .breakdown-heading {
  color: #b35900;
}

.breakdown-formula {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.breakdown-explanation {
  font-size: 1rem;
  font-weight: 600;
  color: #005b47;
  line-height: 1.45;
}

.solution-breakdown.hint-mode .breakdown-explanation {
  color: #8c4400;
}

/* ---------- Wide Desktop Layout (Zero Scroll Needed) ---------- */
body.shell.wide {
  padding: 50px 14px 18px;
}

.card.game.wide-layout {
  max-width: 1260px;
  width: 98%;
  padding: 16px 22px;
}

.game-main-columns {
  display: grid;
  grid-template-columns: 1fr 315px;
  gap: 18px;
  width: 100%;
  align-items: start;
}

.col-builder-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.col-builder-side .builder-stage,
.col-builder-side .mystery-card,
.col-builder-side .composer-stage,
.col-builder-side .german-word-card {
  max-width: 100%;
  margin-bottom: 0;
}

.col-builder-side .mystery-card {
  padding: 14px 18px;
  gap: 10px;
}

.col-builder-side .composer-stage {
  padding: 14px 18px;
  gap: 10px;
}

.col-keypad-side {
  width: 100%;
  position: sticky;
  top: 60px;
}

.keypad-panel-card {
  background: #fbfbfd;
  border: 3px solid #dfe6e9;
  border-radius: 22px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.keypad-panel-card .answer-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.keypad-panel-card .answer-label {
  font-size: 1rem;
  font-weight: 800;
  color: var(--ink);
  text-align: center;
}

.keypad-panel-card .answer-input {
  width: 140px;
  min-height: 54px;
  font-size: 2rem;
  border-radius: 14px;
}

.keypad-panel-card .keypad {
  max-width: 280px;
  gap: 6px;
  margin: 0;
}

.keypad-panel-card .key {
  min-height: 48px;
  font-size: 1.25rem;
  border-radius: 12px;
}

.keypad-panel-card .key-clear {
  min-height: 44px;
  font-size: 0.95rem;
}

.panel-action-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 280px;
  margin-top: 2px;
}

.panel-action-controls .btn {
  width: 100%;
  min-height: 48px;
  padding: 8px 14px;
  font-size: 1.1rem;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.panel-action-controls .btn-go {
  order: 1;
}

.panel-action-controls .btn-hint {
  order: 2;
  min-height: 44px;
  font-size: 0.95rem;
}

.panel-action-controls .btn-again {
  order: 3;
}

.keypad-panel-card .feedback {
  margin: 2px 0 0;
  min-height: 52px;
  padding: 6px 10px;
  font-size: 0.9rem;
  width: 100%;
  border-radius: 12px;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .game-main-columns {
    grid-template-columns: 1fr;
  }
  .col-keypad-side {
    position: static;
  }
}

@media (max-width: 760px) {
  .german-word {
    font-size: 2.1rem;
  }
  .builder-stage {
    flex-direction: column;
    align-items: center;
  }
  .toolbox {
    width: 100%;
    max-width: 440px;
  }
  .build-mat {
    width: 100%;
  }
  .drop-columns {
    flex-direction: column;
  }
  .drop-zone {
    min-height: 140px;
  }
}
