/* MCRdle. The board's tiles are drawn with the game's own art: elixir drops, arena medallions, tooltip pills. */

/* ---------- header ---------- */
.dle-top { display: flex; align-items: center; justify-content: space-between; gap: 14px 20px; flex-wrap: wrap; padding: 36px 0 20px; }
.dle-title { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.dle-title h1 { font-family: var(--font-pixel); font-size: clamp(18px, 3vw, 24px); line-height: 1.4; text-transform: uppercase; }
.dle-date { font-family: var(--font-terminal); font-size: 22px; line-height: 1; color: var(--ink-muted); }
.dle-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dle-next { margin-right: 8px; }
.dle-next .px { display: none; }
@media (max-width: 720px) {
  .dle-top { padding-top: 24px; }
  .dle-tools { width: 100%; }
  .dle-next { margin-right: auto; }
  .dle-next .px { display: block; }
  .dle-next .nx-text { display: none; }
}
@media (max-width: 380px) {
  .dle-next .px { display: none; }
  .dle-tools .btn-sm:not(.btn-icon) { padding: 0 8px 3px; }
}
.clock { font-family: var(--font-terminal); font-weight: 400; font-size: 20px; letter-spacing: .04em; color: var(--ink); text-transform: none; }
.practice { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 16px; padding: 10px 12px 10px 16px; font-size: 14px; color: var(--ink-soft); background: var(--panel-raised); border: 2px solid var(--accent-shade); clip-path: var(--clip-px1); }

/* ---------- mode tabs ---------- */
.dle-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: var(--gap); }
a.dle-tab { color: var(--ink); }
a.dle-tab:hover { text-decoration: none; }
.dle-new { padding: 3px 6px 2px; font-family: var(--font-pixel); font-size: 7px; letter-spacing: .06em; color: var(--accent-deep); background: var(--accent); clip-path: var(--clip-px1); }
.dle-tab { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px 12px; }
.tab-text { flex: 1; min-width: 0; }
.dle-tab strong { display: block; font-family: var(--font-pixel); font-weight: 400; font-size: 11px; line-height: 1.4; text-transform: uppercase; letter-spacing: .04em; }
.dle-tab small { display: block; margin-top: 4px; font-family: var(--font-terminal); font-size: 18px; line-height: 1; color: var(--ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dle-tab[aria-selected="true"] strong { color: var(--accent); }
.tab-status { display: flex; align-items: center; gap: 8px; flex: none; }
.tab-score { font-family: var(--font-terminal); font-size: 22px; line-height: 1; color: var(--ink-muted); }
.dle-tab[data-result="win"] .tab-score { color: #5fe08f; }
.dle-tab[data-result="lose"] .tab-score { color: #ff7b89; }
@media (max-width: 720px) {
  .dle-tabs { gap: 6px; }
  .dle-tab { flex-direction: column; gap: 6px; padding: 10px 6px 12px; text-align: center; }
  .dle-tab small { display: none; }
  .dle-tab strong { font-size: 9px; }
  .tab-status .px { display: none; }
  .tab-score { font-size: 18px; }
}

/* ---------- the stage ---------- */
.dle-stage { margin-bottom: var(--gap); }
.dle-stage .panel-body { padding: 16px; }
.dle-search { position: relative; margin-bottom: 16px; }
.dle-search form { display: flex; gap: 10px; align-items: flex-start; }
.dle-input { flex: 1; min-width: 0; height: 48px !important; font-size: 24px !important; padding: 0 14px !important; }
.dle-list { position: absolute; left: 0; right: 0; top: 54px; z-index: 30; max-height: 336px; overflow-y: auto; margin: 0; padding: 4px; list-style: none; background: var(--bg-deep); border: 2px solid var(--accent); clip-path: var(--clip-px1); box-shadow: 0 8px 0 rgba(0, 0, 0, .4); }
.dle-opt { display: flex; align-items: center; gap: 12px; padding: 6px 10px 6px 6px; cursor: pointer; }
.dle-opt[aria-selected="true"], .dle-opt:hover { background: var(--panel-raised); box-shadow: inset 3px 0 0 var(--accent); }
.dle-opt .mc-card { filter: none; }
.dle-opt b { display: block; font-family: var(--font-terminal); font-weight: 400; font-size: 22px; line-height: 1; }
.dle-opt small { display: block; margin-top: 2px; color: var(--ink-muted); font-size: 12px; font-weight: 500; }
.dle-empty { padding: 14px; color: var(--ink-muted); text-align: center; }
@media (max-width: 560px) { .dle-search .btn { padding: 0 14px 3px; } .dle-stage .panel-body { padding: 12px; } }

/* hints (Card mode) */
.hints { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 10px; margin-bottom: 16px; }
.hint { align-items: flex-start; }
.hint .px { margin-top: 2px; }
.hint:not(.open) { opacity: .7; }
.hint-value { margin-top: 4px; font-size: 14px; color: var(--ink-muted); }
.hint.open .hint-value { color: var(--ink); font-weight: 500; }
@media (max-width: 720px) { .hints { grid-template-columns: 1fr; gap: 6px; } }

/* ---------- the board (Card mode, and the homepage preview) ---------- */
.dle-board { display: grid; gap: 6px; }
.dle-head, .dle-row { display: grid; grid-template-columns: minmax(150px, 1.3fr) repeat(6, minmax(0, 1fr)); gap: 6px; align-items: stretch; }
.dle-head span {
  display: block; text-align: center; padding: 0 0 8px; border-bottom: 2px solid var(--edge);
  font-family: var(--font-pixel); font-size: 8px; line-height: 1.4; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-muted);
}
.dle-head .dle-name-h { text-align: left; }
.dle-head i { font-style: normal; }
.dle-head .short { display: none; }
.board-empty { margin: 14px 0 4px; text-align: center; color: var(--ink-muted); font-size: 14px; }
.dle-name { display: flex; align-items: center; gap: 10px; min-width: 0; font-family: var(--font-terminal); font-size: 21px; line-height: 1; }
.dle-name .nm { min-width: 0; }
.dle-tile { height: 78px; min-width: 0; --tc: #2f9a58; --te: #1b6034; }
.dle-tile[data-state="part"] { --tc: #c98a12; --te: #7a4c04; }
.dle-tile[data-state="no"] { --tc: #b73a48; --te: #6a1a24; }
.tile-face {
  position: relative; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 4px;
  color: #fff; font-family: var(--font-terminal); text-align: center; clip-path: var(--clip-px1); background: var(--tc); border: 2px solid var(--te);
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .26), inset -2px -2px 0 rgba(0, 0, 0, .26); text-shadow: 2px 2px 0 rgba(0, 0, 0, .35);
}
.tile-face img { flex: none; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .35)); }
.t-num, .t-word { font-size: 20px; line-height: 1; }
.t-medal + .t-num { margin-top: -2px; }
.t-pills { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.t-short { display: none; font-size: 16px; line-height: 1; white-space: pre-line; }
.t-arrow { position: absolute; top: 5px; right: 5px; fill: #fff; filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, .55)); }
.dle-tile.flip .tile-face { animation: tile-flip 320ms steps(5, end) calc(var(--i) * .24s) both; }
@keyframes tile-flip { 0% { transform: scaleY(0); opacity: 0; } 100% { transform: none; opacity: 1; } }
.dle-row.enter .dle-name { animation: row-in 200ms steps(4, end) both; }
@keyframes row-in { from { opacity: 0; transform: translateX(-8px); } }
/* two category pills are too wide for a tile below this width: show short names */
@media (max-width: 1000px) {
  [data-key="cats"] .t-pills { display: none; }
  [data-key="cats"] .t-short { display: block; }
}
@media (max-width: 720px) {
  .dle-head, .dle-row { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
  .dle-head .dle-name-h { display: none; }
  .dle-head .full { display: none; }
  .dle-head .short { display: inline; }
  .dle-head span { font-size: 7px; letter-spacing: 0; padding-bottom: 6px; }
  .dle-row { margin-top: 6px; }
  .dle-name { grid-column: 1 / -1; gap: 8px; font-size: 20px; }
  .dle-name .mc-card { --s: 1 !important; filter: none; }
  .dle-tile { height: 58px; }
  .tile-face { gap: 3px; padding: 2px; }
  .t-drop, .t-medal { zoom: .5; }
  .t-icon { zoom: .6667; }
  .t-pill { display: none; }
  .t-word { font-size: 13px; }
  .t-short { display: block; font-size: 15px; }
  .t-num { font-size: 16px; }
  .t-arrow { top: 3px; right: 3px; width: 10px; height: 6px; }
}

/* ---------- Pixel mode ---------- */
.zoom-wrap { display: grid; justify-items: center; gap: 14px; padding: 4px 0; }
.zoom { display: block; }
.zoom canvas { display: block; width: 320px; height: 320px; image-rendering: pixelated; image-rendering: crisp-edges; }
.zoom.pop canvas { animation: zoom-pop 240ms steps(3, end); }
@keyframes zoom-pop { from { filter: brightness(1.7); } }
.zoom-note { margin: 0; text-align: center; font-size: 14px; color: var(--ink-muted); }
@media (max-width: 420px) { .zoom canvas { width: 256px; height: 256px; } }

/* the guesses so far, in a hotbar */
.guess-bar { display: grid; justify-items: center; gap: 10px; margin-top: 8px; text-align: center; }
.guess-bar .label { max-width: 60ch; line-height: 1.8; }

/* ---------- Clue mode ---------- */
.clues { display: grid; gap: 8px; margin: 0 0 8px; padding: 0; list-style: none; }
.clue { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 14px; align-items: center; min-height: 62px; padding: 10px 12px; background: var(--bg-deep); border: 2px solid var(--edge); clip-path: var(--clip-px1); box-shadow: var(--shadow-inset); }
.clue > .px { justify-self: center; opacity: .6; }
.clue .label { display: block; margin-bottom: 6px; }
.clue-value { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; font-family: var(--font-terminal); font-size: 23px; line-height: 1.05; color: var(--ink-faint); }
.clue.open { background: var(--panel-raised); border-color: var(--edge-light); box-shadow: inset 3px 0 0 var(--accent); }
.clue.open .clue-value { color: var(--ink); }
.clue.fresh { animation: clue-in 240ms steps(4, end) both; }
.clue-value.desc { display: block; font-family: var(--font-sans); font-weight: 500; font-size: 15px; line-height: 1.45; }
@keyframes clue-in { from { opacity: 0; transform: translateX(-10px); } }
.letters { display: inline-flex; flex-wrap: wrap; gap: 4px; letter-spacing: 0; }
.letters i { display: inline-grid; place-items: end center; width: 20px; height: 28px; border-bottom: 3px solid var(--accent); font-style: normal; font-size: 24px; line-height: 1; color: var(--ink); }
.letters i.gap { border-color: transparent; width: 10px; }
.letters i.mark { border-color: transparent; width: 10px; }

/* ---------- result ---------- */
.result { margin-bottom: var(--gap); animation: result-in 280ms steps(5, end) both; }
@keyframes result-in { from { opacity: 0; transform: translateY(12px); } }
.result.win::before { --cc: #1d6e3d; border-color: #1d6e3d; }
.result.lose::before { --cc: var(--no-deep); border-color: var(--no-deep); }
.result.win .panel-head .panel-title { color: #5fe08f; }
.result.lose .panel-head .panel-title { color: #ff8793; }
.result-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; padding: 16px; }
.result-side { display: grid; gap: 14px; min-width: 0; }
.result-line { margin: 0; font-size: 16px; font-weight: 500; }
.streak-line { display: flex; align-items: center; gap: 10px; font-family: var(--font-terminal); font-size: 22px; line-height: 1; color: var(--ink-soft); }
.share-preview { margin: 0; white-space: pre; font-family: var(--font-terminal); font-size: 20px; line-height: 1.15; padding: 12px 14px; overflow-x: auto; background: var(--bg-deep); border: 2px solid var(--edge); clip-path: var(--clip-px1); box-shadow: var(--shadow-inset); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.result-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-top: 12px; border-top: 2px solid var(--edge); }
@media (max-width: 860px) { .result-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .result-grid { padding: 12px; } .result .tooltip-frame { border-width: 16px; border-image-width: 16px; } }

/* ---------- dialogs ---------- */
.howto p { color: var(--ink-soft); }
.howto-modes { display: grid; gap: 10px; margin: 0 0 16px; padding: 0; list-style: none; }
.howto-modes li { display: flex; align-items: flex-start; gap: 12px; }
.howto-modes b { display: block; font-family: var(--font-pixel); font-weight: 400; font-size: 10px; text-transform: uppercase; margin-bottom: 4px; color: var(--accent); }
.howto-modes span { font-size: 14px; color: var(--ink-soft); }
.legend { display: grid; gap: 8px; margin: 0 0 16px; padding: 12px; background: var(--bg-deep); border: 2px solid var(--edge); clip-path: var(--clip-px1); }
.legend > div { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.sw { width: 24px; height: 24px; flex: none; clip-path: var(--clip-px1); border: 2px solid rgba(0, 0, 0, .35); box-shadow: inset 2px 2px 0 rgba(255, 255, 255, .26); }
.sw.ok { background: #2f9a58; }
.sw.part { background: #c98a12; }
.sw.no { background: #b73a48; }
.stat-seg { display: flex; width: 100%; margin-bottom: 16px; }
.stat-nums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.stat-nums .stat-value { margin: 0 0 4px; }
.dist-label { display: block; margin-bottom: 8px; }
.dist { display: grid; gap: 6px; }
.dist-row { display: grid; grid-template-columns: 16px 1fr; gap: 8px; align-items: center; font-family: var(--font-terminal); font-size: 20px; }
.dist-bar { min-width: 26px; padding: 0 8px; text-align: right; line-height: 24px; color: var(--accent-deep); background: var(--accent-shade); box-shadow: inset 0 2px 0 #e0a040; }
.dist-bar.hl { color: #062814; background: var(--ok); box-shadow: inset 0 2px 0 #8ff0b4; }
.note { margin: 14px 0 0; font-size: 13px; color: var(--ink-muted); }
.dlg-in > .note:first-child { margin: 0 0 14px; }
.archive { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.archive-row { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto 64px; gap: 12px; align-items: center; padding: 6px 10px; color: var(--ink); background: var(--bg-deep); border: 2px solid var(--edge); clip-path: var(--clip-px1); }
.archive-row:hover { text-decoration: none; background: var(--panel-raised); }
.archive-row.current { border-color: var(--accent); }
.archive-row b { font-family: var(--font-pixel); font-weight: 400; font-size: 10px; color: var(--accent); }
.archive-date { font-family: var(--font-terminal); font-size: 21px; line-height: 1; }
.archive-marks { display: flex; gap: 4px; }
.archive-marks .dim { opacity: .35; }
.archive-go { font-family: var(--font-pixel); font-size: 8px; text-transform: uppercase; text-align: right; color: var(--ink-muted); }
@media (max-width: 480px) { .archive-row { grid-template-columns: 44px minmax(0, 1fr) auto; } .archive-go { display: none; } }
@media (max-width: 720px) { .dle-tab-kg strong { font-size: 7px; letter-spacing: 0; } .dle-new { display: none; } }
