@import url('https://fonts.googleapis.com/css2?family=Gowun+Dodum&display=swap');

:root {
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", Arial, sans-serif;
  color: #1d1d1f;
  background: #f6f6f3;
  --correct: #5d8f45;
  --present: #c8a431;
  --absent: #777b80;
  --border: #d3d6da;
  --panel: #ffffff;
  --ink-soft: #666b70;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at top, #ffffff 0, #f6f6f3 48%, #efefea 100%); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.app-shell { width: min(1120px, calc(100% - 28px)); margin: 0 auto; padding: 24px 0 48px; }
.student-shell { width: min(760px, calc(100% - 20px)); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 2px solid #222; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.55rem, 5vw, 2.2rem); letter-spacing: -0.04em; }
h2 { margin-bottom: 10px; letter-spacing: -0.03em; }
.eyebrow { margin-bottom: 4px; color: var(--ink-soft); font-weight: 800; font-size: .78rem; letter-spacing: .08em; }
.teacher-link, .ghost-button { color: #333; background: #fff; border: 1px solid #d4d4d4; border-radius: 999px; padding: 9px 13px; text-decoration: none; font-weight: 800; cursor: pointer; }
.hint-card { margin: 18px 0 10px; padding: 16px 18px; background: #fff; border: 1px solid #e2e2dc; border-radius: 16px; box-shadow: 0 5px 20px rgba(0,0,0,.035); }
.hint-label { display: inline-block; margin-bottom: 7px; padding: 3px 8px; border-radius: 999px; background: #191919; color: white; font-size: .72rem; font-weight: 800; }
.hint-card p { margin: 0; font-weight: 700; line-height: 1.55; }
.status-row { display: flex; justify-content: space-between; padding: 3px 2px 10px; color: var(--ink-soft); font-size: .86rem; font-weight: 800; }
.board-wrap { width: 100%; overflow-x: auto; padding: 2px 0 8px; }
.board { --cols: 5; --tile: clamp(27px, 7.6vw, 48px); display: grid; gap: 5px; justify-content: center; min-width: max-content; margin: 0 auto; }
.board.empty-state { display: flex; align-items: center; justify-content: center; min-width: 100%; min-height: 210px; color: #858585; border: 1px dashed #c9c9c3; border-radius: 14px; }
.board-row { display: grid; grid-template-columns: repeat(var(--cols), var(--tile)); gap: 5px; }
.tile { width: var(--tile); height: var(--tile); border: 2px solid var(--border); background: #fff; display: grid; place-items: center; font-weight: 900; font-size: clamp(.85rem, 3vw, 1.28rem); border-radius: 4px; transition: transform .12s ease, background .25s ease, border-color .25s ease, color .25s ease; }
.tile.filled { border-color: #888c90; transform: scale(1.03); }
.tile.correct, .key.correct, .legend-box.correct { background: var(--correct); border-color: var(--correct); color: #fff; }
.tile.present, .key.present, .legend-box.present { background: var(--present); border-color: var(--present); color: #fff; }
.tile.absent, .key.absent, .legend-box.absent { background: var(--absent); border-color: var(--absent); color: #fff; }
.message { min-height: 24px; margin: 7px 0 8px; text-align: center; color: #585858; font-size: .9rem; font-weight: 800; }
.keyboard { display: grid; gap: 6px; margin: 0 auto; max-width: 720px; user-select: none; }
.key-row { display: flex; gap: 4px; justify-content: center; }
.key { min-width: 0; flex: 1 1 0; height: clamp(42px, 10vw, 54px); max-width: 58px; padding: 0 4px; border: 0; border-radius: 6px; background: #d3d6da; color: #171717; font-weight: 900; cursor: pointer; }
.key.action { max-width: 82px; flex-grow: 1.35; font-size: .78rem; }
.key:active { transform: translateY(1px); }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 16px; color: #666; font-size: .75rem; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-box { width: 14px; height: 14px; display: inline-block; border-radius: 3px; }
.claim-dialog { width: min(420px, calc(100% - 28px)); border: 0; border-radius: 18px; padding: 0; box-shadow: 0 24px 70px rgba(0,0,0,.25); }
.claim-dialog::backdrop { background: rgba(0,0,0,.45); backdrop-filter: blur(2px); }
.claim-dialog form { padding: 24px; }
.dialog-copy { color: var(--ink-soft); line-height: 1.55; }
.stack-form { display: grid; gap: 15px; }
label { display: grid; gap: 7px; font-weight: 800; }
label small { color: var(--ink-soft); font-weight: 500; line-height: 1.4; }
input, textarea, select { width: 100%; border: 1px solid #d5d5d0; border-radius: 10px; background: white; padding: 11px 12px; outline: none; }
input:focus, textarea:focus, select:focus { border-color: #60646a; box-shadow: 0 0 0 3px rgba(40,40,40,.08); }
.primary-button { border: 0; border-radius: 10px; background: #181818; color: #fff; padding: 12px 16px; font-weight: 900; cursor: pointer; }
.form-message { min-height: 18px; margin: 0; color: #a2372d; font-size: .84rem; font-weight: 700; }
.panel { background: var(--panel); border: 1px solid #e0e0dc; border-radius: 18px; padding: 20px; box-shadow: 0 8px 28px rgba(0,0,0,.035); }
.auth-panel { max-width: 480px; margin: 34px auto 0; }
.teacher-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.panel-heading { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.panel-heading.wrap { align-items: center; flex-wrap: wrap; }
.panel-heading h2 { margin-bottom: 0; }
.meta-list { margin: 20px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; }
.meta-list dt { color: var(--ink-soft); font-weight: 800; }
.meta-list dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.leaderboard-panel { margin-top: 16px; }
.leaderboard-panel select { width: auto; min-width: 210px; }
.table-wrap { overflow-x: auto; margin-top: 16px; }
table { width: 100%; border-collapse: collapse; min-width: 660px; }
th, td { text-align: left; border-bottom: 1px solid #ecece8; padding: 11px 10px; font-size: .9rem; }
th { color: var(--ink-soft); font-size: .78rem; }
.empty-cell { text-align: center; color: #8a8a86; padding: 24px; }
@media (max-width: 760px) {
  .teacher-grid { grid-template-columns: 1fr; }
  .app-shell { padding-top: 14px; }
  .board { --tile: clamp(25px, 8vw, 42px); }
}

/* Student UI refresh: pastel classroom theme */
.student-page {
  --student-ink: #514b5f;
  --student-soft: #7a718b;
  --lavender: #eee8ff;
  --lavender-strong: #d9cdfc;
  --mint: #e8f8ef;
  --mint-strong: #c8ead7;
  --peach: #fff0e7;
  --peach-strong: #ffd7c2;
  --pink: #ffeaf2;
  --cream: #fffaf0;
  color: var(--student-ink);
  background:
    radial-gradient(circle at 8% 7%, rgba(238,232,255,.9) 0 9%, transparent 24%),
    radial-gradient(circle at 92% 18%, rgba(232,248,239,.9) 0 8%, transparent 24%),
    radial-gradient(circle at 50% 100%, rgba(255,234,242,.75) 0 12%, transparent 32%),
    #fff9fc;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", Arial, sans-serif;
}
.student-page .student-shell { width: min(780px, calc(100% - 20px)); padding-top: 20px; }
.student-page .student-topbar {
  position: relative;
  padding: 18px 20px;
  border: 1px solid #e8dff4;
  border-bottom: 3px solid #dfd2f2;
  border-radius: 24px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 10px 28px rgba(93,75,119,.08);
  overflow: hidden;
}
.student-page .student-topbar::after {
  content: "";
  position: absolute;
  width: 110px;
  height: 110px;
  right: -34px;
  top: -58px;
  border-radius: 50%;
  background: var(--pink);
  z-index: 0;
}
.student-page .student-topbar > * { position: relative; z-index: 1; }
.student-page .title-group { display: flex; align-items: center; gap: 12px; }
.student-page .title-sticker {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 15px;
  background: var(--lavender);
  box-shadow: inset 0 -2px 0 rgba(112,92,150,.08);
  font-size: 1.25rem;
}
.student-page h1 { color: #4f4760; }
.student-page .eyebrow { color: #8c77a7; }
.student-page .title-copy { margin: 5px 0 0; color: var(--student-soft); font-size: .82rem; font-weight: 700; }
.student-page .teacher-link {
  border-color: #eadff3;
  background: #fff;
  color: #78658c;
  box-shadow: 0 4px 12px rgba(93,75,119,.06);
}
.student-page .teacher-link:hover { background: var(--lavender); }

.student-page .howto-card {
  margin: 16px 0 12px;
  border: 1px solid #dfd6f0;
  border-radius: 20px;
  background: rgba(247,243,255,.94);
  box-shadow: 0 7px 20px rgba(93,75,119,.055);
  overflow: hidden;
}
.student-page .howto-card summary {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.student-page .howto-card summary::-webkit-details-marker { display: none; }
.student-page .howto-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: #8b72aa;
  font-weight: 900;
  box-shadow: 0 3px 10px rgba(93,75,119,.08);
}
.student-page .howto-card summary > span:nth-child(2) { display: grid; gap: 2px; }
.student-page .howto-card summary strong { font-size: .92rem; }
.student-page .howto-card summary small { color: var(--student-soft); font-size: .72rem; font-weight: 700; }
.student-page .chevron { margin-left: auto; color: #917ba9; font-size: 1.2rem; transition: transform .2s ease; }
.student-page .howto-card[open] .chevron { transform: rotate(180deg); }
.student-page .howto-content { padding: 0 16px 16px; border-top: 1px dashed #ded3ed; }
.student-page .howto-lead { margin: 13px 0; color: #635a70; font-size: .84rem; line-height: 1.65; }
.student-page .rule-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.student-page .rule-item {
  padding: 12px 10px;
  border: 1px solid rgba(108,91,128,.08);
  border-radius: 14px;
  background: rgba(255,255,255,.82);
}
.student-page .rule-example { display: flex; gap: 4px; margin-bottom: 8px; }
.student-page .mini-tile {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 2px solid var(--border);
  border-radius: 5px;
  background: #fff;
  color: #333;
  font-family: Pretendard, "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-weight: 900;
  font-size: .78rem;
}
.student-page .mini-tile.correct { background: var(--correct); border-color: var(--correct); color: #fff; }
.student-page .mini-tile.present { background: var(--present); border-color: var(--present); color: #fff; }
.student-page .mini-tile.absent { background: var(--absent); border-color: var(--absent); color: #fff; }
.student-page .rule-item p { margin: 0; color: #6d6578; font-size: .73rem; line-height: 1.45; }
.student-page .input-tip {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 13px;
  background: var(--cream);
  border: 1px solid #f3e7c9;
}
.student-page .input-tip p { margin: 0; color: #71664e; font-size: .75rem; line-height: 1.55; }

.student-page .hint-card {
  position: relative;
  margin: 12px 0 10px;
  padding: 17px 18px 18px;
  border: 1px solid #d8ebdf;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(232,248,239,.96), rgba(248,255,251,.97));
  box-shadow: 0 8px 22px rgba(76,121,91,.06);
}
.student-page .hint-heading { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.student-page .hint-emoji { font-size: 1rem; }
.student-page .hint-label {
  margin: 0;
  padding: 4px 9px;
  background: #fff;
  color: #58806a;
  border: 1px solid #d4e9dc;
  font-size: .72rem;
}
.student-page .hint-card p { color: #405e4c; font-size: 1rem; line-height: 1.6; }
.student-page .status-row { gap: 8px; padding: 3px 1px 11px; }
.student-page .status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: .76rem;
}
.student-page .attempt-pill { background: var(--peach); color: #8b624e; }
.student-page .length-pill { background: var(--lavender); color: #725f8b; margin-left: auto; }
.student-page .board-wrap {
  padding: 13px 8px 12px;
  border: 1px solid #eee7f2;
  border-radius: 22px;
  background: rgba(255,255,255,.8);
  box-shadow: 0 9px 25px rgba(93,75,119,.05);
}
.student-page .board.empty-state { border-color: #ddd4e5; color: #91889b; background: #fffafd; }
.student-page .tile {
  font-family: Pretendard, "Noto Sans KR", "Malgun Gothic", sans-serif;
  border-radius: 7px;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.025);
}
.student-page .message { color: #7d638d; min-height: 26px; margin: 8px 0 6px; }
.student-page .keyboard-card {
  margin-top: 2px;
  padding: 12px 8px 10px;
  border-radius: 20px;
  background: rgba(255,255,255,.65);
}
.student-page .keyboard-caption { margin: 0 0 9px; text-align: center; color: #8b8296; font-size: .72rem; font-weight: 800; }
.student-page .keyboard { margin: 0 auto; }
.student-page .key {
  font-family: Pretendard, "Noto Sans KR", "Malgun Gothic", sans-serif;
  border-radius: 8px;
  box-shadow: 0 2px 0 rgba(61,62,66,.12);
}
.student-page .key.action { background: #c8cbd0; }
.student-page .student-footer { margin: 17px 0 0; text-align: center; color: #9a8ea4; font-size: .72rem; font-weight: 700; }
.student-page .student-claim-dialog { border-radius: 24px; background: #fffafd; }
.student-page .student-claim-dialog form { text-align: center; padding: 25px; }
.student-page .student-claim-dialog label { text-align: left; }
.student-page .celebrate { font-size: 2rem; margin-bottom: 5px; }
.student-page .student-claim-dialog .primary-button { margin-top: 4px; background: #7c6a95; border-radius: 12px; }
.student-page .student-claim-dialog input:focus { border-color: #aa96c4; box-shadow: 0 0 0 3px rgba(170,150,196,.18); }

@media (max-width: 620px) {
  .student-page .student-topbar { padding: 15px 14px; border-radius: 20px; }
  .student-page .title-sticker { width: 38px; height: 38px; border-radius: 13px; }
  .student-page .title-copy { display: none; }
  .student-page .teacher-link { padding: 7px 10px; font-size: .74rem; }
  .student-page .rule-grid { grid-template-columns: 1fr; }
  .student-page .rule-item { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; }
  .student-page .rule-example { margin: 0; }
  .student-page .howto-card summary small { font-size: .68rem; }
  .student-page .hint-card { padding: 15px; }
  .student-page .board-wrap { padding-left: 5px; padding-right: 5px; }
}

/* 2026-08 classroom UI refinements */
.student-page,
.student-page button:not(.key),
.student-page input,
.student-page textarea,
.student-page select,
.teacher-shell,
.teacher-shell button,
.teacher-shell input,
.teacher-shell textarea,
.teacher-shell select {
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", Arial, sans-serif;
}

/* Keep the actual Kordle jamo/tiles in a clean gothic face. */
.student-page .tile,
.student-page .key,
.student-page .mini-tile,
.student-page .rule-example {
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", Pretendard, "Noto Sans KR", sans-serif;
}

.student-page .published-at {
  margin: 11px 0 0;
  padding-top: 9px;
  border-top: 1px dashed #cfe2d6;
  color: #718276;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .01em;
}

.teacher-shell .current-panel {
  align-self: start;
}
.teacher-account-row { margin-bottom: 8px; }
.current-puzzle-details {
  overflow: hidden;
  border: 1px solid #e1e1dc;
  border-radius: 14px;
  background: #fafaf7;
}
.current-puzzle-details > summary {
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  padding: 14px 42px 14px 15px;
  cursor: pointer;
  list-style: none;
  font-weight: 900;
  user-select: none;
}
.current-puzzle-details > summary::-webkit-details-marker { display: none; }
.current-puzzle-details > summary::after {
  content: "▾";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%) rotate(0deg);
  transition: transform .18s ease;
}
.current-puzzle-details:not([open]) > summary::after { transform: translateY(-50%) rotate(-90deg); }
.current-puzzle-details > summary small { color: #777; font-size: .72rem; font-weight: 700; }
.current-puzzle-secret { padding: 15px; border-top: 1px dashed #d9d9d3; background: #fff; }
.secret-label { margin: 0 0 4px; color: #777; font-size: .74rem; font-weight: 800; }
.current-puzzle-secret h3 { margin: 0 0 14px; font-size: clamp(1.35rem, 3vw, 1.8rem); }
.danger-button {
  margin-top: 12px;
  padding: 10px 14px;
  border: 1px solid #e5b9b9;
  border-radius: 10px;
  background: #fff3f3;
  color: #9b3434;
  font-weight: 900;
  cursor: pointer;
}
.danger-button:hover { background: #ffe7e7; }
.danger-button:disabled { opacity: .45; cursor: not-allowed; }

@media (max-width: 620px) {
  .student-page .published-at { font-size: .7rem; }
}


/* Serif interface font override: keep all non-jamo UI consistently readable. */
body,
.student-page,
.student-page button:not(.key),
.student-page input,
.student-page textarea,
.student-page select,
.teacher-shell,
.teacher-shell button,
.teacher-shell input,
.teacher-shell textarea,
.teacher-shell select {
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", Arial, sans-serif;
}

/* Kordle jamo must remain gothic. */
.student-page .tile,
.student-page .key,
.student-page .mini-tile,
.student-page .rule-example {
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}


/* Clean gothic typography override — functional styles remain unchanged. */
html, body,
button, input, textarea, select,
.card, .panel, .modal, .hint-card, .status, .message,
.teacher-panel, .ranking, .leaderboard,
h1, h2, h3, h4, p, span, label, summary, details {
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", Arial, sans-serif;
}

/* Game jamo/keyboard also stay in the same clean gothic family. */
.tile, .key, .keyboard, .game-board, .board {
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", Arial, sans-serif;
}


/* 2026-08 student puzzle stats, creator credit, and optional comment */
.student-page .puzzle-stats {
  display: flex;
  gap: 9px;
  margin-top: 12px;
}
.student-page .puzzle-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 11px;
  border: 1px solid #d5e9dc;
  border-radius: 12px;
  background: rgba(255,255,255,.76);
  color: #557260;
}
.student-page .puzzle-stat strong { font-size: .92rem; color: #3e654d; }
.student-page .puzzle-stat small { font-size: .68rem; font-weight: 800; color: #708177; }
.student-page .published-at {
  margin-top: 8px;
  padding-top: 7px;
  font-size: .64rem;
  font-weight: 600;
  opacity: .78;
}
.student-page .key.submit-key {
  background: #6757d9;
  color: #fff;
  box-shadow: 0 3px 0 #4f43ad, 0 5px 13px rgba(103,87,217,.22);
}
.student-page .key.submit-key:hover { background: #5d4ccc; }
.student-page .key.submit-key:active { transform: translateY(2px); box-shadow: 0 1px 0 #4f43ad; }
.student-page .optional-label {
  display: inline-block;
  margin-left: 5px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #eee8ff;
  color: #756597;
  font-size: .65rem;
  font-weight: 800;
  vertical-align: middle;
}
.student-page .student-claim-dialog textarea { resize: vertical; min-height: 74px; }
.student-page .student-claim-dialog textarea:focus { border-color: #aa96c4; box-shadow: 0 0 0 3px rgba(170,150,196,.18); }
.student-page .creator-link {
  display: inline-block;
  margin-top: 5px;
  color: #7b6b8d;
  font-size: .68rem;
  font-weight: 800;
  text-decoration: none;
}
.student-page .creator-link:hover { text-decoration: underline; }
.comment-cell { min-width: 180px; max-width: 360px; white-space: normal; line-height: 1.45; }
.muted { color: #aaa; }
@media (max-width: 620px) {
  .student-page .puzzle-stat { padding: 7px 9px; }
  .student-page .puzzle-stat strong { font-size: .84rem; }
  .student-page .published-at { font-size: .61rem; }
}


/* 2026-08 reissue + hall of fame */
.student-page .hall-button {
  margin-left: auto;
  padding: 8px 11px;
  border: 1px solid #e4d48e;
  border-radius: 12px;
  background: linear-gradient(135deg, #fff4b9, #ffe7a7);
  color: #725519;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(130, 93, 20, .10);
}
.student-page .hall-button:hover { filter: brightness(.98); }
.student-page .hall-button:disabled { opacity: .45; cursor: not-allowed; }
.hall-dialog {
  width: min(92vw, 480px);
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: transparent;
}
.hall-dialog::backdrop { background: rgba(50, 45, 62, .42); backdrop-filter: blur(2px); }
.hall-dialog-card {
  position: relative;
  padding: 25px;
  border: 1px solid #eee3b6;
  border-radius: 22px;
  background: #fffdf5;
  box-shadow: 0 18px 55px rgba(61, 49, 25, .18);
}
.hall-dialog-card h2 { margin: 3px 0 8px; }
.hall-copy { margin: 0 0 16px; color: #766b54; font-size: .8rem; line-height: 1.55; }
.hall-close {
  position: absolute; top: 12px; right: 13px; width: 34px; height: 34px;
  border: 0; border-radius: 50%; background: #f1ede2; color: #635d50;
  font-size: 1.2rem; font-weight: 900; cursor: pointer;
}
.hall-list { display: grid; gap: 8px; }
.hall-entry {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center;
  padding: 10px 12px; border: 1px solid #eee5c9; border-radius: 13px; background: #fff;
}
.hall-rank {
  width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%;
  background: #fff1b8; color: #795b13; font-weight: 900;
}
.hall-person { display: flex; gap: 9px; align-items: center; min-width: 0; }
.hall-person strong { color: #4f4a40; }
.hall-person span { color: #766f62; }
.hall-attempt { padding: 5px 9px; border-radius: 999px; background: #eae5ff; color: #63528c; font-weight: 900; font-size: .78rem; }
.hall-empty { margin: 8px 0 2px; padding: 18px; border-radius: 13px; background: #f7f3e9; color: #7d7460; text-align: center; font-size: .8rem; line-height: 1.55; }
.reissue-details { margin-top: 16px; border-top: 1px dashed #ddd8cd; padding-top: 12px; }
.reissue-details > summary { cursor: pointer; font-weight: 900; color: #615975; }
.reissue-body { margin-top: 10px; padding: 13px; border-radius: 12px; background: #f7f5fb; }
.reissue-body p { margin: 0 0 10px; color: #777080; font-size: .78rem; line-height: 1.55; }
.reissue-body label { display: grid; gap: 5px; font-weight: 800; }
.reissue-body select { width: 100%; }
.secondary-button {
  margin-top: 10px; padding: 10px 14px; border: 1px solid #cfc7df; border-radius: 10px;
  background: #eee8fa; color: #5e4e7c; font-weight: 900; cursor: pointer;
}
.secondary-button:hover { background: #e5ddf5; }
.secondary-button:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 620px) {
  .student-page .puzzle-stats { flex-wrap: wrap; }
  .student-page .hall-button { margin-left: 0; width: 100%; }
  .hall-dialog-card { padding: 22px 17px 18px; }
}

/* v4: compact mobile dialogs for rules and hall of fame */
.student-page .howto-trigger {
  width: fit-content;
  max-width: 100%;
  margin: 14px 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border: 1px solid #dfd6f0;
  border-radius: 14px;
  background: rgba(247,243,255,.94);
  color: var(--student-ink);
  box-shadow: 0 5px 14px rgba(93,75,119,.05);
  cursor: pointer;
  text-align: left;
}
.student-page .howto-trigger > span:last-child { display: grid; gap: 0; }
.student-page .howto-trigger strong { font-size: .84rem; }
.student-page .howto-trigger small { color: var(--student-soft); font-size: .66rem; font-weight: 700; }
.student-page .howto-trigger .howto-icon { width: 27px; height: 27px; font-size: .8rem; }

.compact-dialog,
.hall-dialog {
  width: min(88vw, 420px);
  max-height: min(78vh, 620px);
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}
.compact-dialog::backdrop,
.hall-dialog::backdrop { background: rgba(50,45,62,.38); backdrop-filter: blur(2px); }
.compact-dialog-card,
.hall-dialog-card {
  position: relative;
  max-height: min(78vh, 620px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 19px 17px 17px;
  border-radius: 18px;
  -webkit-overflow-scrolling: touch;
}
.howto-dialog-card { border: 1px solid #e2d8f0; background: #fbf9ff; box-shadow: 0 16px 45px rgba(65,52,86,.18); }
.compact-close,
.hall-close {
  position: sticky;
  float: right;
  top: 0;
  z-index: 2;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #efebf3;
  color: #635d6d;
  font-size: 1.05rem;
  font-weight: 900;
  cursor: pointer;
}
.howto-dialog-card h2,
.hall-dialog-card h2 { margin: 2px 36px 7px 0; font-size: 1.08rem; }
.howto-dialog-card .howto-lead { margin: 0 0 11px; font-size: .78rem; line-height: 1.5; }
.compact-rule-grid { display: grid; grid-template-columns: 1fr; gap: 7px; }
.compact-rule-grid .rule-item { padding: 9px 10px; border-radius: 12px; }
.compact-rule-grid .rule-item p { margin: 5px 0 0; font-size: .72rem; line-height: 1.4; }
.compact-tip { margin-top: 9px; padding: 10px; border-radius: 12px; }
.compact-tip p { margin: 0; font-size: .71rem; line-height: 1.5; }

.hall-dialog-card { padding: 19px 16px 16px; border-radius: 18px; }
.hall-copy { margin-bottom: 11px; font-size: .72rem; }
.hall-list { gap: 7px; }
.hall-entry { grid-template-columns: 29px minmax(0,1fr) auto; gap: 8px; padding: 8px 9px; border-radius: 11px; align-items: start; }
.hall-rank { width: 27px; height: 27px; font-size: .75rem; }
.hall-entry-main { min-width: 0; }
.hall-person { gap: 7px; font-size: .76rem; flex-wrap: wrap; }
.hall-comment { margin: 5px 0 0; padding: 6px 8px; border-radius: 9px; background: #fff9df; color: #71613a; font-size: .7rem; line-height: 1.4; overflow-wrap: anywhere; }
.hall-attempt { padding: 4px 7px; font-size: .7rem; white-space: nowrap; }
.hall-empty { padding: 13px 11px; font-size: .74rem; }

@media (max-width: 620px) {
  .student-page .howto-trigger { margin-top: 10px; padding: 7px 10px; }
  .compact-dialog, .hall-dialog { width: min(90vw, 380px); max-height: 72vh; }
  .compact-dialog-card, .hall-dialog-card { max-height: 72vh; padding: 16px 14px 14px; }
  .student-page .hall-button { width: auto; margin-left: auto; padding: 7px 9px; font-size: .76rem; }
  .student-page .puzzle-stats { gap: 7px; }
}

/* v5: inline rules button + teacher record tools */
.student-page .hint-heading .howto-trigger-inline {
  margin: 0 0 0 auto;
  padding: 6px 9px;
  border-radius: 11px;
  box-shadow: none;
  flex: 0 0 auto;
}
.student-page .hint-heading .howto-trigger-inline .howto-icon {
  width: 23px;
  height: 23px;
  font-size: .72rem;
}
.student-page .hint-heading .howto-trigger-inline strong { font-size: .75rem; }
.student-page .hint-heading .howto-trigger-inline small { font-size: .6rem; }

.leaderboard-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
}
.csv-download-button {
  margin-top: 0;
  white-space: nowrap;
}
.record-delete-button {
  padding: 6px 9px;
  border: 1px solid #e4bcbc;
  border-radius: 8px;
  background: #fff3f3;
  color: #9b3f3f;
  font-weight: 800;
  font-size: .72rem;
  cursor: pointer;
  white-space: nowrap;
}
.record-delete-button:hover { background: #ffe7e7; }
.record-delete-button:disabled { opacity: .5; cursor: wait; }

@media (max-width: 620px) {
  .student-page .hint-heading { align-items: center; }
  .student-page .hint-heading .howto-trigger-inline {
    margin: 0 0 0 auto;
    padding: 5px 8px;
  }
  .student-page .hint-heading .howto-trigger-inline small { display: none; }
  .leaderboard-actions { width: 100%; justify-content: flex-start; }
  .leaderboard-actions select { max-width: 100%; }
}

/* Gowun Dodum interface typography - game jamo intentionally excluded. */
:root,
html,
body,
.student-page,
.teacher-shell,
button:not(.key),
input,
textarea,
select,
.card,
.panel,
.modal,
.hint-card,
.status,
.message,
.teacher-panel,
.ranking,
.leaderboard,
h1, h2, h3, h4, p, span, label, summary, details,
th, td, dt, dd, a {
  font-family: "Gowun Dodum", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif !important;
}

/* Do NOT change the game-input typography: answer tiles and on-screen keyboard stay bold gothic. */
.tile,
.key,
.keyboard .key,
.student-page .tile,
.student-page .key,
.student-page .mini-tile,
.student-page .rule-example {
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", Arial, sans-serif !important;
}



/* v6: difficulty + automatic thinking-tool mode */
.student-page .daily-quiz-note {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0 0 8px; color: #766d80;
}
.student-page .daily-quiz-note[hidden] { display: none !important; }
.student-page .daily-quiz-badge {
  display: inline-flex; align-items: center; padding: 5px 8px; border-radius: 999px;
  background: #fff1b9; color: #76591d; font-size: .7rem; font-weight: 900;
  border: 1px solid #eadb98;
}
.student-page .daily-quiz-note small { font-size: .6rem; line-height: 1.35; color: #968e9d; }

.daily-settings-box {
  margin-top: 18px; padding: 15px; border: 1px solid #e4dff0; border-radius: 15px;
  background: #fbf9ff;
}
.daily-settings-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.daily-settings-head h3 { margin: 2px 0 0; }
.daily-toggle { display: inline-flex !important; grid-template-columns: none !important; align-items: center; gap: 7px !important; font-weight: 900; }
.daily-toggle input { width: 18px; height: 18px; margin: 0; }
.daily-settings-copy { margin: 9px 0 12px; color: #756f7d; font-size: .78rem; line-height: 1.55; }
.daily-range-row { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: end; gap: 9px; }
.daily-range-row > span { padding-bottom: 11px; font-weight: 900; color: #91899c; }
.daily-range-row label { display: grid; gap: 5px; }
.daily-settings-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.daily-settings-actions .secondary-button { margin-top: 0; }
@media (max-width: 620px) {
  .student-page .daily-quiz-note { gap: 5px; }
  .student-page .daily-quiz-note small { flex-basis: 100%; font-size: .57rem; }
  .daily-range-row { grid-template-columns: 1fr auto 1fr; }
  .daily-settings-actions { display: grid; grid-template-columns: 1fr; }
}
\n\n/* v6.4: extra-bright yellow student theme for thinking-tool mode only */
.student-page.daily-quiz-theme {
  --student-ink: #4e3d00;
  --student-soft: #7b6400;
  --lavender: #fff07a;
  --lavender-strong: #ffd92f;
  --mint: #fff7a8;
  --mint-strong: #ffe65a;
  --peach: #fff0a8;
  --peach-strong: #ffd34b;
  --pink: #ffe866;
  --cream: #fffbe1;
  color: var(--student-ink);
  background:
    radial-gradient(circle at 7% 5%, rgba(255, 249, 102, .98) 0 13%, transparent 32%),
    radial-gradient(circle at 96% 12%, rgba(255, 232, 36, .96) 0 12%, transparent 31%),
    radial-gradient(circle at 48% 100%, rgba(255, 251, 154, .96) 0 18%, transparent 42%),
    linear-gradient(145deg, #fffde0 0%, #fff36b 42%, #ffe12b 72%, #ffd719 100%);
}
.student-page.daily-quiz-theme .student-topbar {
  border-color: #f1d42f;
  border-bottom-color: #e7bd12;
  background: rgba(255, 253, 220, .94);
  box-shadow: 0 10px 30px rgba(168, 125, 0, .14);
}
.student-page.daily-quiz-theme .student-topbar::after { background: #ffe342; }
.student-page.daily-quiz-theme .title-sticker {
  background: linear-gradient(145deg, #fff58a, #ffd632);
  box-shadow: inset 0 -2px 0 rgba(140, 102, 0, .12);
}
.student-page.daily-quiz-theme h1 { color: #463700; }
.student-page.daily-quiz-theme .eyebrow { color: #9b7200; }
.student-page.daily-quiz-theme .title-copy { color: #756000; }
.student-page.daily-quiz-theme .teacher-link {
  border-color: #efd96b;
  background: #fffdf0;
  color: #745600;
  box-shadow: 0 4px 12px rgba(143, 106, 0, .09);
}
.student-page.daily-quiz-theme .teacher-link:hover { background: #fff3a6; }
.student-page.daily-quiz-theme .hint-card {
  border-color: #eacb31;
  background: linear-gradient(135deg, rgba(255, 248, 143, .98), rgba(255, 226, 70, .97));
  box-shadow: 0 9px 24px rgba(160, 119, 0, .13);
}
.student-page.daily-quiz-theme .hint-label {
  background: #fffdf0;
  color: #755800;
  border-color: #e7c93f;
}
.student-page.daily-quiz-theme .hint-card p { color: #574400; }
.student-page.daily-quiz-theme .daily-quiz-badge {
  background: linear-gradient(135deg, #ffd927, #ffbc16);
  color: #513800;
  border-color: #e5aa00;
  box-shadow: 0 2px 0 rgba(121, 86, 0, .12);
}
.student-page.daily-quiz-theme .daily-quiz-note { color: #6b5500; }
.student-page.daily-quiz-theme .daily-quiz-note small { color: #7f6a18; }
.student-page.daily-quiz-theme .puzzle-stat {
  border-color: #e7c93f;
  background: rgba(255, 253, 228, .88);
  color: #725900;
}
.student-page.daily-quiz-theme .puzzle-stat strong { color: #564200; }
.student-page.daily-quiz-theme .puzzle-stat small { color: #806a14; }
.student-page.daily-quiz-theme .attempt-pill { background: #ffe8a0; color: #775200; }
.student-page.daily-quiz-theme .length-pill { background: #fff18a; color: #725600; }
.student-page.daily-quiz-theme .board-wrap {
  border-color: #edd765;
  background: rgba(255, 254, 235, .88);
  box-shadow: 0 9px 25px rgba(145, 109, 0, .09);
}
.student-page.daily-quiz-theme .keyboard-card {
  background: rgba(255, 252, 218, .72);
  border: 1px solid rgba(226, 196, 50, .35);
}
.student-page.daily-quiz-theme .keyboard-caption { color: #776218; }
.student-page.daily-quiz-theme .message { color: #755800; }
.student-page.daily-quiz-theme .student-footer { color: #806c22; }
.student-page.daily-quiz-theme .creator-link { color: #6f5700; }
.student-page.daily-quiz-theme .hall-button {
  border-color: #dfb900;
  background: linear-gradient(135deg, #ffe95a, #ffc922);
  color: #5b4300;
  box-shadow: 0 2px 0 rgba(128, 91, 0, .14);
}
.student-page.daily-quiz-theme .hint-heading .howto-trigger-inline {
  border-color: #e5c847;
  background: rgba(255, 253, 231, .92);
  color: #674e00;
}
.student-page.daily-quiz-theme .hint-heading .howto-trigger-inline small { color: #8a721d; }

/* Keep gameplay tiles and keyboard keys exactly on their existing visual system. */
.student-page.daily-quiz-theme .tile,
.student-page.daily-quiz-theme .key {
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", Arial, sans-serif;
}

/* v6.4 teacher thinking-tool cadence control */
.thinking-rotation-label { margin-top: 10px; }
.thinking-rotation-label select { background: #fffef8; }
