.dp-sentence-wall-root {
  --sw-yellow: #f8b900;
  --sw-yellow-dark: #eba500;
  --sw-yellow-soft: #fff0bf;
  --sw-green: #a8ce8f;
  --sw-green-strong: #00aa55;
  --sw-red: #ff1010;
  --sw-blue: #9fc5e8;
  --sw-border: #eeeeee;
  --sw-text: #111;
  --sw-shadow: rgba(0, 0, 0, 0.28);
  --sw-bg: #ffffff;
  --sw-card-height: 49px;
  --sw-card-gap: 5px;
  --sw-stagger: 27px;
  color: var(--sw-text);
  font-family: Arial, Helvetica, sans-serif;
}

.dp-sentence-wall-root * { box-sizing: border-box; }

.dp-sentence-wall-root .sentence-wall-page {
  width: 100%;
  min-height: 720px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 5.2vw 2vw 2vw;
  background: var(--sw-bg);
}

.dp-sentence-wall-root .sentence-wall-game {
  width: min(1085px, 96vw);
  position: relative;
  user-select: none;
}

.dp-sentence-wall-root .top-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 12px;
  margin-bottom: 98px;
}

.dp-sentence-wall-root .sentence-display {
  min-height: 54px;
  border-radius: 11px;
  border: 5px solid #ffe48a;
  background: var(--sw-yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 18px;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.2;
  text-align: center;
  color: #000;
}

.dp-sentence-wall-root .submit-wrap {
  padding-top: 59px;
  min-width: 108px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 13px;
}

.dp-sentence-wall-root .action-button {
  min-width: 96px;
  height: 47px;
  border: 2px solid #e9f2e8;
  border-radius: 9px;
  background: var(--sw-blue);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 2px 2px #fff inset, 0 0 0 4px #d8e6d0, 0 4px 8px var(--sw-shadow);
  transition: transform 0.12s ease, background 0.12s ease;
}

.dp-sentence-wall-root .action-button.ready,
.dp-sentence-wall-root .action-button.next { background: var(--sw-green-strong); }
.dp-sentence-wall-root .action-button:disabled { opacity: 0.45; cursor: not-allowed; }
.dp-sentence-wall-root .action-button:hover:not(:disabled) { transform: translateY(-1px); }
.dp-sentence-wall-root .action-button:active:not(:disabled) { transform: translateY(1px); }

.dp-sentence-wall-root .attempt-display {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  width: 100%;
  font-size: 17px;
  color: #222;
}

.dp-sentence-wall-root .attempt-label { font-weight: 600; }

.dp-sentence-wall-root .attempt-number {
  min-width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--sw-yellow);
  border: 4px solid #ffe48a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: #111;
}

.dp-sentence-wall-root .wall-area { position: relative; }

.dp-sentence-wall-root .feedback {
  position: absolute;
  top: -112px;
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(78px, 8vw, 118px);
  font-weight: 500;
  line-height: 1;
  text-shadow: 0 3px 4px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}

.dp-sentence-wall-root .feedback.show { opacity: 1; }
.dp-sentence-wall-root .feedback.wrong { color: red; }
.dp-sentence-wall-root .feedback.correct { color: var(--sw-green-strong); }
.dp-sentence-wall-root .feedback.notice { color: #333; font-size: clamp(34px, 4vw, 56px); }

.dp-sentence-wall-root .columns {
  display: grid;
  grid-template-columns: repeat(8, minmax(90px, 1fr));
  gap: 4px;
  align-items: start;
}

.dp-sentence-wall-root .word-column {
  display: grid;
  grid-auto-rows: var(--sw-card-height);
  gap: var(--sw-card-gap);
}

.dp-sentence-wall-root .word-column.staggered {
  transform: translateY(calc(var(--sw-stagger) * -1));
}

.dp-sentence-wall-root .word-card,
.dp-sentence-wall-root .empty-card {
  height: var(--sw-card-height);
  border-radius: 10px;
  border: 5px solid var(--sw-border);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2px 8px;
  font-size: clamp(16px, 1.6vw, 22px);
  line-height: 1.05;
}

.dp-sentence-wall-root .word-card {
  background: var(--sw-yellow);
  border-color: #ffe48a;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
}

.dp-sentence-wall-root .word-card:hover:not(:disabled) {
  transform: translateY(-1px);
  background: var(--sw-yellow-dark);
}

.dp-sentence-wall-root .word-card.selected-correct {
  background: var(--sw-green);
  border-color: #ddecbd;
  color: #fff;
}

.dp-sentence-wall-root .word-card.selected-wrong {
  background: var(--sw-red);
  border-color: #ffb000;
  color: #fff;
}

.dp-sentence-wall-root .word-card.last-selected {
  outline: 3px solid rgba(255, 255, 255, 0.95);
  outline-offset: -7px;
}

.dp-sentence-wall-root .word-card.locked { cursor: default; }

.dp-sentence-wall-root .empty-card {
  background: var(--sw-yellow-soft);
  border-color: var(--sw-border);
}

.dp-sentence-wall-root .hidden-note {
  margin-top: 76px;
  text-align: center;
  font-size: 24px;
  line-height: 1.35;
  color: #111;
}

.dp-sentence-wall-root .control-panel {
  margin: 28px auto 0;
  max-width: 920px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.dp-sentence-wall-root .small-button {
  border: none;
  border-radius: 10px;
  padding: 11px 12px;
  background: #f1f1f1;
  cursor: pointer;
  font-size: 15px;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
}

.dp-sentence-wall-root .small-button:hover { background: #e8e8e8; }

.dp-sentence-wall-root .stats {
  margin: 16px auto 0;
  max-width: 920px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  font-size: 14px;
}

.dp-sentence-wall-root .stat-card {
  background: #fafafa;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}

.dp-sentence-wall-root .stat-value {
  display: block;
  margin-top: 4px;
  font-size: 20px;
  font-weight: 700;
}

@media (max-width: 920px) {
  .dp-sentence-wall-root .top-row {
    grid-template-columns: 1fr;
    margin-bottom: 34px;
  }
  .dp-sentence-wall-root .submit-wrap {
    padding-top: 0;
    align-items: center;
    justify-content: center;
  }
  .dp-sentence-wall-root .attempt-display { justify-content: center; }
  .dp-sentence-wall-root .columns { grid-template-columns: repeat(4, minmax(90px, 1fr)); }
  .dp-sentence-wall-root .feedback { top: -82px; }
  .dp-sentence-wall-root .control-panel,
  .dp-sentence-wall-root .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .dp-sentence-wall-root {
    --sw-card-height: 46px;
    --sw-stagger: 25px;
  }
  .dp-sentence-wall-root .sentence-wall-page { padding-top: 18px; }
  .dp-sentence-wall-root .columns { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .dp-sentence-wall-root .word-card,
  .dp-sentence-wall-root .empty-card { font-size: 18px; }
  .dp-sentence-wall-root .hidden-note { font-size: 18px; margin-top: 36px; }
  .dp-sentence-wall-root .control-panel,
  .dp-sentence-wall-root .stats { grid-template-columns: 1fr; }
}
