@import url("./tokens.css");
@import url("./effects.css");

* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at 80% 0%, #e6f0e8 0%, transparent 55%), var(--page); min-width: 300px; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
a { color: inherit; }
button:focus-visible, a:focus-visible, .image-stage:focus-visible { outline: 3px solid var(--green); outline-offset: 4px; }
button, a { touch-action: manipulation; }
.container { width: calc(100% - 64px); max-width: var(--content-width); margin-inline: auto; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.game-main { padding-block: 38px 32px; }
.intro { margin-bottom: 26px; }
.eyebrow { margin: 0 0 12px; color: var(--green); font-size: 10px; letter-spacing: 2.1px; font-weight: 750; }
h1 { margin: 0; font-size: clamp(32px, 3.6vw, 50px); line-height: 1.12; font-weight: 700; letter-spacing: -1.8px; }
h1 span { color: var(--green); }
.intro-description { margin: 12px 0 0; color: var(--muted); line-height: 1.65; font-size: 13px; }
.game-toolbar { position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: center; padding: 19px 22px; gap: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 20px; box-shadow: var(--shadow); }
.game-toolbar::after { content: ""; position: absolute; inset: auto 0 0; height: 3px; background: linear-gradient(90deg, var(--green), #7dd3a5); transform: scaleX(var(--progress, 0)); transform-origin: left; transition: transform .55s cubic-bezier(.22, 1, .36, 1); }
.progress-group { display: flex; gap: 24px; align-items: center; }
.progress-label { display: flex; gap: 13px; align-items: baseline; font-size: 13px; font-weight: 500; white-space: nowrap; }
.progress-label strong { font-size: 23px; color: var(--green); font-weight: 650; font-variant-numeric: tabular-nums; }
.progress-total { font-size: 13px; color: var(--muted); }
.progress-dots { display: flex; gap: 5px; }
.progress-dot { display: grid; place-items: center; height: 24px; width: 24px; border-radius: 50%; background: #f0f3ee; color: #8b968e; font-size: 10px; font-weight: 600; transition: background .2s, color .2s; }
.progress-dot.is-found { background: var(--green); color: white; }
.progress-dot.is-hinted { background: var(--hint); }
.toolbar-actions { display: flex; gap: 10px; align-items: center; }
.timer { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; padding-right: 13px; font-variant-numeric: tabular-nums; }
.timer .icon { width: 17px; height: 17px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 42px; padding: 10px 14px; border: 1px solid transparent; border-radius: 10px; font-size: 12px; font-weight: 600; transition: background .15s, transform .2s, box-shadow .2s; }
.button:active:not(:disabled) { transform: scale(.96); }
.button-hint { background: var(--green-soft); color: var(--green-dark); }
.button-hint:hover:not(:disabled) { background: #d2e9dd; }
.button-hint .icon { width: 17px; height: 17px; }
.hint-count { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: white; font-size: 10px; }
.button-reset { background: white; border-color: var(--line); color: var(--muted); }
.button-reset:hover:not(:disabled) { background: var(--page); color: var(--ink); }
.button-reset .icon { width: 16px; height: 16px; }
.boards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.image-card { margin: 0; min-width: 0; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; transition: box-shadow .25s; }
.image-caption { display: flex; justify-content: space-between; align-items: center; padding: 13px 17px; border: 1px solid var(--line); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; gap: 12px; }
.image-title { font-size: 12px; font-weight: 600; }
.zoom-button { display: flex; align-items: center; gap: 6px; padding: 6px 0 6px 8px; border: none; background: transparent; color: var(--muted); font-size: 10px; min-height: 30px; }
.zoom-button .icon { width: 15px; height: 15px; }
.zoom-button:hover { color: var(--green); }
.zoom-button .icon { transition: transform .2s; }
.zoom-button:hover .icon { transform: rotate(-10deg) scale(1.12); }
.image-stage { position: relative; width: 100%; aspect-ratio: 7 / 5; cursor: crosshair; isolation: isolate; background: #e8ede8; }
.image-stage img { display: block; width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.image-stage:focus-visible { outline-offset: -4px; }
.marker-layer, .feedback-layer { position: absolute; inset: 0; pointer-events: none; }
.difference-marker { position: absolute; border: 3px solid var(--green); background: rgb(19 123 101 / 9%); border-radius: 50%; box-shadow: 0 0 0 1px rgb(255 255 255 / 90%), 0 0 12px rgb(19 123 101 / 20%); animation: marker-enter .45s cubic-bezier(.16, 1, .3, 1) both; }
.difference-marker.is-hinted { border-color: var(--hint); background: rgb(238 174 51 / 12%); }
.marker-number { position: absolute; top: -10px; right: -4px; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: white; background: var(--green); font-size: 9px; font-weight: 700; box-shadow: 0 0 0 1px white; }
.is-hinted .marker-number { background: var(--hint); }
.keyboard-cursor { display: none; position: absolute; left: var(--cursor-x, 50%); top: var(--cursor-y, 50%); width: 22px; height: 22px; border-radius: 50%; border: 2px solid white; box-shadow: 0 0 0 2px #20352c; transform: translate(-50%, -50%); pointer-events: none; }
.keyboard-cursor::before, .keyboard-cursor::after { content: ""; position: absolute; background: white; box-shadow: 0 0 1px #20352c; }
.keyboard-cursor::before { top: 8px; left: 4px; width: 10px; height: 2px; }
.keyboard-cursor::after { left: 8px; top: 4px; width: 2px; height: 10px; }
.image-stage:focus-visible .keyboard-cursor { display: block; }
.miss-marker { position: absolute; height: 22px; width: 22px; transform: translate(-50%, -50%); border-radius: 50%; border: 2px solid #d97859; background: rgb(255 255 255 / 35%); animation: miss-enter .6s ease-out both; }
.feedback-toast { position: fixed; z-index: 10; left: 50%; bottom: 22px; margin: 0; display: flex; align-items: center; gap: 9px; max-width: calc(100% - 32px); width: max-content; padding: 13px 18px; border: 1px solid #cee6d9; border-radius: 14px; color: var(--green-dark); background: rgb(250 255 251 / 97%); box-shadow: 0 8px 30px rgb(20 53 35 / 12%); backdrop-filter: blur(12px); font-size: 12px; line-height: 1.5; opacity: 0; visibility: hidden; transform: translate(-50%, 12px) scale(.96); transition: opacity .2s, transform .3s cubic-bezier(.22, 1, .36, 1), visibility .2s; pointer-events: none; }
.feedback-toast.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, 0) scale(1); }
.feedback-toast.is-miss { color: #93533f; border-color: #eddbd1; background: #fffaf6; }
.feedback-toast .icon { width: 17px; height: 17px; }
.sr-only { position: absolute; height: 1px; width: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.error-notice { padding: 12px; color: #93533f; font-size: 14px; }
dialog { color: var(--ink); border: 1px solid var(--line); border-radius: 22px; padding: 24px; box-shadow: 0 24px 80px rgb(16 37 28 / 22%); max-height: calc(100dvh - 32px); }
dialog::backdrop { background: rgb(17 33 27 / 56%); backdrop-filter: blur(4px); }
.dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.dialog-header h2 { margin: 0; font-size: 20px; letter-spacing: -.4px; }
.icon-button { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--muted); }
.icon-button:hover { background: var(--page); }
.zoom-dialog { width: min(1100px, calc(100% - 32px)); }
.zoom-tabs { display: inline-flex; gap: 4px; margin-top: 16px; padding: 4px; border-radius: 10px; background: var(--page); }
.zoom-tab { border: 0; border-radius: 7px; padding: 10px 16px; font-size: 12px; background: transparent; color: var(--muted); }
.zoom-tab[aria-pressed="true"] { background: var(--green); color: white; }
.zoom-description { color: var(--muted); font-size: 12px; line-height: 1.6; }
.zoom-viewport { overflow: auto; max-height: 64dvh; border-radius: 12px; overscroll-behavior: contain; }
.zoom-viewport .image-stage { width: max(100%, 700px); }
.zoom-status { margin: 14px 0 0; color: var(--green-dark); font-size: 12px; }
.win-dialog { position: fixed; isolation: isolate; width: min(460px, calc(100% - 32px)); text-align: center; padding: 44px 30px 28px; }
.win-close { position: absolute; right: 14px; top: 14px; }
.win-emblem { position: relative; display: grid; place-items: center; margin: 8px auto 26px; width: 84px; height: 84px; border-radius: 50%; color: var(--green); background: var(--green-soft); box-shadow: 0 0 0 10px #f3f8f3; }
.win-emblem > .icon { width: 43px; height: 43px; stroke-width: 2; }
.emblem-spark { position: absolute; color: #b88f48; font-size: 22px; }
.spark-one { top: -13px; right: -19px; }.spark-two { bottom: 0; left: -25px; font-size: 15px; }
.win-dialog h2 { margin: 10px 0 14px; font-size: 32px; letter-spacing: -1px; }
.win-dialog #win-description { color: var(--muted); line-height: 1.7; font-size: 13px; }
.win-stats { display: grid; grid-template-columns: 1fr 1fr; margin: 24px 0; padding: 18px 0; background: var(--page); border-radius: 12px; }
.win-stats > div { display: flex; flex-direction: column; gap: 8px; }
.win-stats > div + div { border-left: 1px solid var(--line); }
.win-stats span { color: var(--muted); font-size: 10px; }
.win-stats strong { color: var(--green-dark); font-size: 19px; font-weight: 600; }
.button-primary { width: 100%; color: white; background: var(--green); min-height: 48px; font-size: 13px; }
.button-primary:hover { background: var(--green-dark); }
.text-button { border: 0; background: transparent; color: var(--muted); font-size: 11px; margin-top: 10px; padding: 12px 4px; }
.is-embedded .game-main { padding-top: 28px; }
@keyframes marker-enter { 0% { opacity: 0; transform: scale(.45); } 65% { opacity: 1; transform: scale(1.14); } 100% { opacity: 1; transform: scale(1); } }
@keyframes miss-enter { 0% { opacity: 1; } 100% { opacity: 0; } }
@media (min-width: 1464px) { .container { width: 1400px; } }
@media (max-width: 1050px) {
  .progress-group { gap: 14px; }
  .progress-dots { gap: 4px; }
  .progress-dot { height: 20px; width: 20px; font-size: 9px; }
  .game-toolbar { padding-inline: 16px; }
  .toolbar-actions { gap: 7px; }
  .timer { padding-right: 4px; }
}
@media (max-width: 800px) {
  .container { width: calc(100% - 32px); }
  .game-main { padding-top: 30px; }
  .intro { margin-bottom: 24px; }
  .game-toolbar { flex-wrap: wrap; gap: 16px; padding: 16px; }
  .progress-group { flex: 1; justify-content: space-between; }
  .progress-dot { width: 22px; height: 22px; }
  .toolbar-actions { width: 100%; justify-content: flex-end; }
  .timer { margin-right: auto; }
  .boards { grid-template-columns: 1fr; gap: 18px; }
}
@media (max-width: 440px) {
  h1 { font-size: 32px; letter-spacing: -1.3px; }
  .intro-description { font-size: 12px; margin-top: 12px; }
  .eyebrow { font-size: 9px; }
  .game-toolbar { padding: 14px 12px; }
  .progress-group { gap: 10px; }
  .progress-label { gap: 8px; font-size: 12px; }
  .progress-dot { width: 17px; height: 17px; font-size: 8px; }
  .progress-dots { gap: 3px; }
  .button { min-height: 44px; }
  .image-caption { padding: 9px 12px; }
  .image-title { font-size: 11px; }
  .difference-marker { border-width: 2px; }
  .marker-number { width: 15px; height: 15px; font-size: 8px; top: -8px; right: -4px; }
  .feedback-toast { font-size: 11px; padding: 12px 14px; bottom: 16px; }
  .zoom-dialog { padding: 16px; }
  .dialog-header h2 { font-size: 17px; }
  .win-dialog { padding-inline: 20px; }
}
@media (max-width: 359px) { .progress-group { flex-wrap: wrap; }.progress-dots { flex: 1; justify-content: flex-end; }.progress-dot { width: 14px; height: 14px; }.progress-dots { gap: 2px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
