@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --ink: #ece9e2;
  --muted: #8d8b8e;
  --dim: #535157;
  --line: rgba(236, 233, 226, .18);
  --paper: #101014;
  --card: #17171d;
  --green: #2f946b;
  --yellow: #f3d35b;
  --blue: #59a7ff;
  --acid: var(--green);
  --orange: var(--yellow);
  --violet: var(--blue);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: 'Space Grotesk', system-ui, sans-serif;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .27;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}

button { font: inherit; }

.game-shell { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 28px 0 32px; }
[hidden] { display: none !important; }
.landing-page { display: flex; flex-direction: column; justify-content: center; width: min(760px, calc(100% - 48px)); min-height: 100vh; margin: 0 auto; padding: 54px 0; }
.landing-page::before { content: '01 / 04'; position: absolute; top: 34px; right: 34px; color: var(--dim); font: 10px 'DM Mono', monospace; letter-spacing: .12em; }
.landing-page { position: relative; }
.landing-page::after { content: ''; position: absolute; right: -180px; bottom: 9%; width: 340px; height: 340px; border: 1px solid rgba(73,217,154,.12); border-radius: 50%; box-shadow: 0 0 0 24px rgba(243,211,91,.025), 0 0 0 48px rgba(89,167,255,.025); pointer-events: none; }
.landing-mark { width: 58px; height: 58px; margin-bottom: 44px; }
.landing-mark img { width: 100%; height: 100%; }
.landing-page h1 { margin: 0 0 28px; }
.landing-intro { max-width: 510px; margin: 0 0 48px; color: var(--muted); font-size: 18px; line-height: 1.5; }
.size-picker { margin-bottom: 34px; }
.size-picker { padding: 18px 20px 20px; border: 1px solid var(--line); background: rgba(23,23,29,.72); box-shadow: 12px 12px 0 rgba(73,217,154,.05); }
.picker-label { margin: 0 0 13px; color: var(--dim); font: 10px 'DM Mono', monospace; letter-spacing: .14em; text-transform: uppercase; }
.size-options { display: flex; gap: 9px; }
.size-option { width: 72px; height: 58px; border: 1px solid var(--line); color: var(--muted); background: #17171d; font: 16px 'DM Mono', monospace; cursor: pointer; transition: color .25s ease, border-color .25s ease, transform .25s ease, background .25s ease; }
.size-option:hover, .size-option:focus-visible { border-color: var(--acid); color: var(--ink); transform: translateY(-3px); outline: none; }
.size-option.is-selected { border-color: var(--acid); color: #101014; background: var(--acid); box-shadow: 0 0 28px rgba(73,217,154,.16); }
.start-button { display: flex; justify-content: space-between; align-items: center; width: min(300px, 100%); padding: 16px 0; border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--ink); background: transparent; text-align: left; cursor: pointer; font: 12px 'DM Mono', monospace; letter-spacing: .13em; text-transform: uppercase; transition: color .25s ease, padding .25s ease; }
.start-button span { color: var(--acid); font-size: 20px; transition: transform .25s ease; }
.start-button:hover { padding-left: 8px; color: var(--acid); }
.start-button:hover span { transform: translate(4px, -4px); }
.loading-screen { position: fixed; z-index: 40; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(12,12,15,.98); animation: veilIn .45s ease both; }
.loading-panel { width: min(560px, 100%); }
.loading-copy { min-height: 145px; display: flex; align-items: center; }
.loading-quote { max-width: 520px; margin: 0; color: var(--ink); font-size: clamp(24px, 3.5vw, 44px); line-height: 1; letter-spacing: -.045em; opacity: 0; }
.loading-quote.is-visible { animation: quoteInOut 3s ease both; }
.loading-quote.is-final { opacity: 1; animation: quoteInStay .6s ease both; }
.loading-bar { height: 5px; margin-top: 36px; overflow: hidden; background: #25252c; }
.loading-bar span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--green), var(--yellow), var(--blue)); box-shadow: 0 0 18px rgba(73,217,154,.55); transition: width .25s ease; }
.loading-status { margin: 12px 0 26px; color: var(--dim); font: 10px 'DM Mono', monospace; letter-spacing: .12em; text-transform: uppercase; }
.loading-enter { animation: modalIn .6s cubic-bezier(.16,1,.3,1) both; }
.game-header { display: flex; align-items: center; gap: 24px; border-bottom: 1px solid var(--line); margin-bottom: 24px; padding-bottom: 20px; }
.game-header { position: relative; }
.brand { display: flex; flex: 0 0 auto; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; letter-spacing: .1em; font: 500 16px 'DM Mono', monospace; }
.brand-icon { width: 37px; height: 38px; overflow: visible; }
.header-divider { align-self: stretch; width: 1px; min-height: 38px; background: var(--line); }
.game-header h1 { font-size: clamp(24px, 3.2vw, 42px); line-height: .95; }
.game-hud { display: flex; gap: 16px; align-items: center; margin-left: auto; }
.hud-item { display: grid; grid-template-columns: auto auto; column-gap: 8px; align-items: baseline; padding-left: 14px; border-left: 1px solid var(--line); }
.hud-item small { grid-column: 1 / -1; color: var(--dim); font: 8px 'DM Mono', monospace; letter-spacing: .16em; }
.hud-item strong { color: var(--acid); font: 20px 'DM Mono', monospace; }
.hud-item i { color: var(--dim); font: normal 11px 'DM Mono', monospace; }
.eyebrow { margin: 0 0 16px; color: var(--acid); font: 11px 'DM Mono', monospace; letter-spacing: .13em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(52px, 8vw, 102px); line-height: .86; letter-spacing: -.075em; font-weight: 600; }
h1 em, h2 em { color: var(--orange); font-style: normal; }
.board-wrap { padding-top: 0; }
.board { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.memory-card { position: relative; aspect-ratio: .7; min-height: 190px; padding: 0; border: 0; border-radius: 7px; color: var(--ink); background: transparent; text-align: left; appearance: none; perspective: 900px; cursor: pointer; transition: opacity .55s ease, transform .55s cubic-bezier(.2,.8,.2,1), filter .55s ease; }
.memory-card.is-active { z-index: 3; transform: translateY(-10px) scale(1.045); filter: drop-shadow(0 16px 18px rgba(0,0,0,.36)); }
.memory-card.is-keeping { z-index: 4; animation: cardKeepLift .72s cubic-bezier(.2,.9,.25,1) both; }
.memory-card.is-fading-away { z-index: 5; animation: cardFadeLift .72s cubic-bezier(.2,.9,.25,1) both; }
.memory-card.is-hidden { opacity: 0; transform: translateY(26px) scale(.76); pointer-events: none; }
.memory-card.is-kept { opacity: 1; filter: none; cursor: pointer; }
.memory-card.is-kept .card-face { box-shadow: 0 0 0 1px var(--acid), 0 0 28px rgba(232,255,99,.08); }
.card-inner { display: block; width: 100%; height: 100%; position: relative; transition: transform .7s cubic-bezier(.2,.85,.25,1); transform-style: preserve-3d; }
.memory-card.is-flipped .card-inner { transform: rotateY(180deg); }
.card-face { position: absolute; inset: 0; border-radius: 7px; backface-visibility: hidden; -webkit-backface-visibility: hidden; transform-style: preserve-3d; -webkit-transform-style: preserve-3d; overflow: hidden; }
.card-back { display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #373944 0 2px, transparent 3px), linear-gradient(135deg, #262731 25%, #1c1d25 25% 50%, #262731 50% 75%, #1c1d25 75%); background-size: 100% 100%, 18px 18px; border: 1px solid #4b4c59; box-shadow: inset 0 0 0 5px #16171d, inset 0 0 0 7px rgba(73,217,154,.15), 0 10px 0 #0b0c10; }
.card-back::before { content: ''; position: absolute; inset: 14px; border: 1px solid rgba(236,233,226,.2); transform: rotate(45deg); }
.card-back::after { content: '∞'; color: var(--acid); font: 500 48px 'Space Grotesk', sans-serif; text-shadow: 0 0 18px rgba(73,217,154,.34); }
.memory-card.is-wrong { animation: wrongShake .25s ease-in-out 3; }
.memory-card:hover:not(.is-hidden) .card-back { border-color: var(--yellow); box-shadow: inset 0 0 0 5px #16171d, inset 0 0 0 7px rgba(243,211,91,.22), 0 14px 0 #0b0c10; }
.memory-card.is-hiding { animation: hideWrong .35s cubic-bezier(.2,.8,.2,1) both; pointer-events: none; }
.card-front { transform: rotateY(180deg); display: flex; flex-direction: column; padding: 11px 18px 18px; border: 1px solid var(--line); background: #17171d; opacity: 1; }
.card-front::before { content: ''; position: absolute; z-index: 2; left: 0; top: 0; width: 2px; height: 27px; background: var(--card-accent, var(--acid)); }
.memory-card.has-image .card-front::after { content: ''; position: absolute; z-index: 0; inset: 0; background-image: linear-gradient(to bottom, rgba(9,11,10,.12) 5%, rgba(9,11,10,.28) 45%, rgba(9,11,10,.96) 88%), var(--card-image); background-position: center; background-size: cover; }
.memory-card.has-image .card-front > * { position: relative; z-index: 1; }
.memory-card.has-image .card-front h3 { position: absolute; right: 0; bottom: 0; left: 0; margin: 0; padding: 14px 18px 17px; border: 0; border-top: 1px solid rgba(255,255,255,.18); border-radius: 0; color: var(--ink); background: linear-gradient(135deg, rgba(45,47,51,.9), rgba(20,21,24,.84)); box-shadow: 0 -8px 22px rgba(0,0,0,.28); backdrop-filter: blur(6px); }
.card-front h3 { position: absolute; z-index: 1; right: 0; bottom: 0; left: 0; margin: 0; padding: 14px 18px 17px; border-top: 1px solid var(--line); background: #202027; font-size: clamp(17px, 1.9vw, 24px); line-height: 1; letter-spacing: -.045em; }
.game-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 20px; color: var(--dim); font: 10px 'DM Mono', monospace; text-transform: uppercase; letter-spacing: .08em; }
kbd { padding: 4px 6px; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); }
.restart-button { padding: 0; border: 0; color: var(--muted); background: transparent; cursor: pointer; text-transform: uppercase; letter-spacing: .08em; }
.restart-button:hover { color: var(--acid); }
.restart-button span { padding-left: 7px; color: var(--acid); font-size: 16px; }
.modal-backdrop { position: fixed; z-index: 50; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(5,5,7,.78); backdrop-filter: blur(12px); animation: veilIn .35s ease both; }
.modal-backdrop[hidden], .win-backdrop[hidden] { display: none; }
.card-modal, .win-message { position: relative; width: min(500px, 100%); padding: 34px; border: 1px solid rgba(232,255,99,.55); background: #16161b; box-shadow: 0 25px 90px rgba(0,0,0,.55), 0 0 45px rgba(232,255,99,.08); animation: modalIn .55s cubic-bezier(.16,1,.3,1) both; }
.card-modal { max-height: calc(100vh - 48px); overflow-y: auto; }
.modal-close { position: absolute; top: 11px; right: 13px; display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 0; color: var(--muted); background: transparent; font-size: 27px; line-height: 1; cursor: pointer; }
.modal-close:hover:not(:disabled) { color: var(--acid); }
.modal-close:disabled { color: var(--dim); cursor: wait; }
.modal-countdown { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; pointer-events: none; }
.modal-countdown circle { fill: none; stroke: var(--acid); stroke-width: 1.6; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; }
.modal-is-locked .modal-progress-circle { stroke-dashoffset: 0; animation: countdownRing 10s linear forwards; }
.modal-is-locked .modal-close > span { opacity: .45; }
.modal-continue:disabled { color: var(--dim); cursor: wait; opacity: .55; }
.modal-topline { display: flex; justify-content: flex-start; gap: 18px; padding-right: 48px; color: var(--acid); font: 10px 'DM Mono', monospace; letter-spacing: .12em; }
.modal-topline span:last-child { color: var(--muted); }
.modal-image-frame { position: relative; height: 210px; margin: 22px 0 0; border: 1px solid var(--line); overflow: hidden; background: #0b0c0e; }
.modal-image-frame[hidden] { display: none; }
.modal-image-frame::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to bottom, rgba(13,14,16,.05) 24%, rgba(13,14,16,.28) 57%, rgba(13,14,16,.96) 100%); }
.modal-image-frame img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; filter: saturate(.82) contrast(1.06); }
.card-modal.modal-has-image .modal-hero { position: relative; height: 280px; margin: 22px -34px 22px; overflow: hidden; }
.card-modal.modal-has-image .modal-image-frame { position: absolute; inset: 0; height: auto; margin: 0; border: 0; }
.card-modal.modal-has-image .modal-hero h2 { position: absolute; z-index: 1; bottom: 24px; left: 34px; width: calc(100% - 68px); max-width: 400px; margin: 0; padding: 13px 14px 15px; border: 1px solid rgba(255,255,255,.2); border-radius: 4px; color: var(--ink); background: linear-gradient(135deg, rgba(45,47,51,.88), rgba(20,21,24,.82)); box-shadow: 0 10px 28px rgba(0,0,0,.48); backdrop-filter: blur(7px); }
.card-modal h2 { max-width: 390px; margin: 58px 0 22px; font-size: clamp(28px, calc(6vw - 6px), 54px); line-height: .9; letter-spacing: -.065em; }
.modal-rule { height: 1px; background: var(--line); }
.card-modal p { margin: 25px 0; color: #c2c0bd; font-size: 16px; line-height: 1.55; }
.modal-description { margin: 25px 0; }
.card-modal .modal-description p { margin: 0; }
.card-modal .modal-description p + p { margin-top: 18px; }
.modal-description strong { color: var(--ink); font-weight: 750; }
.modal-prompt { color: var(--acid); font-size: 14px; line-height: 1.4; }
.card-modal.prompt-first .modal-prompt { margin-top: 25px; }
.card-modal.prompt-first p { margin-top: 18px; }
.card-modal.prompt-first .modal-description p:first-child { margin-top: 0; }
.modal-sources { margin-top: 24px; padding-top: 15px; border-top: 1px solid var(--line); }
.modal-sources-label { display: block; color: var(--dim); font: 9px 'DM Mono', monospace; letter-spacing: .16em; text-transform: uppercase; }
.modal-sources-list { display: grid; gap: 7px; margin: 10px 0 0; padding: 0; list-style: none; }
.modal-sources-list a { display: inline-flex; gap: 7px; align-items: baseline; color: #a9bde0; font: 11px/1.4 'DM Mono', monospace; text-decoration: none; }
.modal-sources-list a::before { content: '↗'; flex: 0 0 auto; color: var(--acid); }
.modal-sources-list a:hover, .modal-sources-list a:focus-visible { color: var(--ink); text-decoration: underline; text-decoration-color: var(--acid); text-underline-offset: 3px; }
.modal-continue { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: 29px; padding: 13px 0; border: 0; border-top: 1px solid var(--line); color: var(--ink); background: transparent; text-align: left; cursor: pointer; font: 11px 'DM Mono', monospace; text-transform: uppercase; letter-spacing: .1em; }
.modal-continue:hover { color: var(--acid); }
.modal-continue span { font-size: 18px; }
.win-message { width: min(620px, 100%); }
.win-message h2 { margin: 30px 0 14px; font-size: clamp(50px, 8vw, 86px); line-height: .85; letter-spacing: -.08em; }
.win-message p:not(.eyebrow) { max-width: 310px; color: var(--muted); line-height: 1.5; }

/* Game UI */
body { background: radial-gradient(circle at 50% -20%, #1e2430 0, #101014 42%, #090a0d 100%); }
body::before { opacity: .5; background-image: linear-gradient(rgba(89,167,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(89,167,255,.045) 1px, transparent 1px); background-size: 32px 32px; mask-image: linear-gradient(to bottom, black 20%, transparent 90%); }
body::after { content: ''; position: fixed; z-index: -1; inset: 0; pointer-events: none; background: repeating-linear-gradient(to bottom, transparent 0 3px, rgba(255,255,255,.012) 4px); }
.landing-page { width: min(1180px, calc(100% - 40px)); padding: 36px 0; }
.landing-page::before, .landing-page::after { display: none; }
.landing-console { position: relative; width: 100%; border: 1px solid rgba(89,167,255,.34); background: linear-gradient(145deg, rgba(25,27,35,.96), rgba(10,11,15,.98)); box-shadow: 0 0 0 4px #0c0d12, 0 0 0 5px rgba(73,217,154,.14), 0 35px 100px rgba(0,0,0,.6); clip-path: polygon(22px 0, calc(100% - 22px) 0, 100% 22px, 100% calc(100% - 22px), calc(100% - 22px) 100%, 22px 100%, 0 calc(100% - 22px), 0 22px); }
.landing-console::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, var(--green), var(--yellow), var(--blue)) top / 100% 3px no-repeat; opacity: .9; }
.console-header, .console-footer { display: flex; align-items: center; min-height: 54px; padding: 0 24px; border-bottom: 1px solid rgba(255,255,255,.1); color: var(--dim); font: 10px 'DM Mono', monospace; letter-spacing: .12em; }
.console-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 500; }
.console-brand img { width: 28px; height: 28px; }
.system-status { margin-left: auto; color: var(--green); }
.system-status i { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); animation: statusPulse 1.6s ease-in-out infinite; }
.console-level { margin-left: 28px; padding-left: 28px; border-left: 1px solid var(--line); color: var(--yellow); }
.console-body { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(380px, .75fr); min-height: 590px; }
.landing-copy { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 64px 7vw 64px 56px; overflow: hidden; }
.landing-copy::after { content: '∞'; position: absolute; right: -42px; bottom: -110px; color: rgba(73,217,154,.035); font: 500 390px/1 'Space Grotesk', sans-serif; }
.landing-copy .eyebrow { position: relative; z-index: 1; }
.landing-copy h1 { position: relative; z-index: 1; font-size: clamp(66px, 8vw, 112px); text-shadow: 0 6px 0 rgba(0,0,0,.32); }
.landing-copy h1 em { color: var(--yellow); text-shadow: 0 0 32px rgba(243,211,91,.14); }
.landing-intro { position: relative; z-index: 1; max-width: 540px; }
.mission-tags { position: relative; z-index: 1; display: flex; gap: 8px; flex-wrap: wrap; }
.mission-tags span { padding: 7px 10px; border: 1px solid rgba(89,167,255,.24); color: #8192ad; background: rgba(89,167,255,.045); font: 9px 'DM Mono', monospace; letter-spacing: .12em; }
.size-picker { display: flex; flex-direction: column; justify-content: center; margin: 0; padding: 44px; border: 0; border-left: 1px solid rgba(255,255,255,.1); background: linear-gradient(180deg, rgba(89,167,255,.055), rgba(73,217,154,.025)); box-shadow: none; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 36px; padding-bottom: 14px; border-bottom: 1px solid rgba(255,255,255,.13); color: var(--ink); font: 12px 'DM Mono', monospace; letter-spacing: .12em; }
.panel-heading b { color: var(--blue); font-size: 22px; }
.picker-label { color: #6f7180; }
.size-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.size-option { position: relative; display: grid; align-content: center; width: auto; height: 112px; padding: 14px; border: 1px solid #363945; color: #7d7f8b; background: linear-gradient(145deg, #20222b, #15161d); text-align: left; clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 13px, 100% 100%, 0 100%); }
.size-option::after { content: ''; position: absolute; right: 8px; bottom: 8px; width: 20px; height: 3px; background: currentColor; opacity: .45; }
.size-option small, .size-option i { font: normal 8px 'DM Mono', monospace; letter-spacing: .14em; }
.size-option strong { margin: 4px 0 0; color: var(--ink); font: 500 30px/1 'DM Mono', monospace; }
.size-option:hover, .size-option:focus-visible { border-color: var(--blue); color: var(--blue); transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,.25); }
.size-option.is-selected { border-color: var(--yellow); color: var(--yellow); background: linear-gradient(145deg, rgba(243,211,91,.16), rgba(243,211,91,.045)); box-shadow: inset 0 0 28px rgba(243,211,91,.06), 0 0 24px rgba(243,211,91,.08); }
.size-option.is-selected strong { color: var(--yellow); }
.size-picker .start-button { display: grid; grid-template-columns: 1fr 52px; align-items: center; width: 100%; margin-top: 22px; padding: 0; border: 1px solid var(--green); color: #07110d; background: var(--green); box-shadow: 0 0 26px rgba(73,217,154,.18); clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 13px, 100% 100%, 0 100%); }
.size-picker .start-button:hover { padding: 0; color: #07110d; background: #70edb5; box-shadow: 0 0 38px rgba(73,217,154,.32); transform: translateY(-2px); }
.button-icon { display: grid; place-items: center; height: 54px; border: 0; font-size: 12px !important; color: #07110d !important; }
.button-label { padding-left: 14px; color: inherit !important; font-size: 11px !important; }
.console-footer { justify-content: space-between; min-height: 42px; border-top: 1px solid rgba(255,255,255,.1); border-bottom: 0; }
.console-footer span:nth-child(2) { color: #6f7180; }
.game-shell { width: min(1220px, calc(100% - 40px)); }
.game-header { padding: 14px 18px; border: 1px solid rgba(89,167,255,.25); background: rgba(17,18,24,.86); box-shadow: 0 12px 35px rgba(0,0,0,.25); clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%); }
.board-wrap { position: relative; padding: 38px 26px 26px; border: 1px solid rgba(89,167,255,.2); background: rgba(12,13,18,.75); box-shadow: inset 0 0 60px rgba(89,167,255,.025); clip-path: polygon(15px 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%, 0 15px); }
.board-topline { position: absolute; top: 0; right: 0; left: 0; display: flex; justify-content: space-between; align-items: center; height: 28px; padding: 0 12px; border-bottom: 1px solid rgba(255,255,255,.08); color: #606372; font: 8px 'DM Mono', monospace; letter-spacing: .15em; }
.board-topline span:first-child { color: var(--blue); }
.memory-card { border-radius: 2px; }
.card-face { border-radius: 2px; }
.card-back { box-shadow: inset 0 0 0 4px #111218, inset 0 0 0 6px rgba(73,217,154,.2), 0 8px 0 #07080b; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%); }
.memory-card:hover:not(.is-hidden) { transform: translateY(-5px); filter: drop-shadow(0 14px 14px rgba(0,0,0,.38)); }
.game-footer { margin-top: 10px; padding: 12px 14px; border: 1px solid rgba(255,255,255,.08); background: rgba(17,18,24,.65); }
.loading-panel { padding: 34px; border: 1px solid rgba(89,167,255,.3); background: #111219; box-shadow: 0 0 0 5px #090a0d, 0 28px 90px rgba(0,0,0,.6); clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px); }
@keyframes statusPulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
@keyframes veilIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(24px) rotate(2deg) scale(.96); } to { opacity: 1; transform: translateY(0) rotate(0) scale(1); } }
@keyframes countdownRing { from { stroke-dashoffset: 0; } to { stroke-dashoffset: -100; } }
@keyframes cardKeepLift { 0% { transform: translateY(-10px) scale(1.045); filter: drop-shadow(0 16px 18px rgba(0,0,0,.36)); } 50% { transform: translateY(-18px) scale(1.055); filter: drop-shadow(0 24px 24px rgba(0,0,0,.42)); } 100% { transform: translateY(-10px) scale(1.045); filter: drop-shadow(0 16px 18px rgba(0,0,0,.36)); } }
@keyframes cardFadeLift { 0% { opacity: 1; transform: translateY(-10px) scale(1.045); filter: drop-shadow(0 16px 18px rgba(0,0,0,.36)); } 100% { opacity: 0; transform: translateY(-28px) scale(.98); filter: drop-shadow(0 26px 26px rgba(0,0,0,.08)); } }
@keyframes wrongShake { 0%, 100% { transform: translateX(0) rotate(0); } 25% { transform: translateX(-5px) rotate(-1deg); } 50% { transform: translateX(5px) rotate(1deg); } 75% { transform: translateX(-3px) rotate(-.5deg); } }
@keyframes hideWrong { from { opacity: 1; transform: translateY(0) scale(1); } to { opacity: 0; transform: translateY(12px) scale(.88); } }
@keyframes quoteInOut { 0% { opacity: 0; transform: translateY(12px); } 15%, 65% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-10px); } }
@media (max-width: 780px) { .game-shell { width: min(100% - 28px, 620px); padding-top: 18px; } .board { grid-template-columns: repeat(4, 1fr); gap: 8px; } .memory-card { min-height: 140px; } .card-front { padding: 8px 12px 12px; } .card-front h3, .memory-card.has-image .card-front h3 { padding: 11px 12px 13px; font-size: 16px; } }
@media (max-width: 440px) { .landing-page { width: min(100% - 32px, 620px); } .landing-page::before { top: 18px; right: 16px; } .landing-page::after { right: -220px; } .landing-mark { margin-bottom: 32px; } .landing-intro { margin-bottom: 36px; font-size: 16px; } .size-option { flex: 1; width: auto; } .game-header { gap: 14px; flex-wrap: wrap; } .brand { gap: 7px; font-size: 10px; } .brand-icon { width: 29px; height: 30px; } .header-divider { min-height: 32px; } .game-header h1 { font-size: 21px; order: 3; flex-basis: 100%; } .game-hud { margin-left: auto; } .board { grid-template-columns: repeat(3, 1fr); } .game-footer span:first-child { display: none; } .card-modal { padding: 26px; } .card-modal.modal-has-image .modal-hero { margin-right: -26px; margin-left: -26px; } .card-modal.modal-has-image .modal-hero h2 { left: 26px; width: calc(100% - 52px); padding: 12px 13px 14px; } }
@media (max-width: 900px) { .console-body { grid-template-columns: 1fr; } .landing-copy { min-height: 490px; padding: 55px 42px; } .size-picker { padding: 38px 42px 44px; border-top: 1px solid rgba(255,255,255,.1); border-left: 0; } }
@media (max-width: 540px) { .landing-page { width: calc(100% - 20px); padding: 10px 0; } .landing-console { clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0 calc(100% - 12px), 0 12px); } .console-header { padding: 0 14px; } .system-status { display: none; } .console-level { margin-left: auto; padding-left: 14px; } .landing-copy { min-height: 410px; padding: 44px 22px; } .landing-copy h1 { font-size: clamp(52px, 17vw, 76px); } .landing-intro { margin-bottom: 28px; } .size-picker { padding: 30px 20px 34px; } .size-options { gap: 7px; } .size-option { height: 100px; padding: 11px; } .console-footer { padding: 0 14px; } .console-footer span:nth-child(2) { display: none; } .board-wrap { padding: 36px 10px 14px; } }

/* Playful board-game direction */
body { background: radial-gradient(circle at 12% 18%, rgba(73,217,154,.13), transparent 24%), radial-gradient(circle at 88% 12%, rgba(243,211,91,.12), transparent 22%), radial-gradient(circle at 82% 82%, rgba(89,167,255,.12), transparent 25%), #101014; }
body::before { opacity: .3; background-image: radial-gradient(circle, rgba(255,255,255,.11) 1px, transparent 1.5px); background-size: 25px 25px; mask-image: none; }
body::after { background: none; }
.landing-console { overflow: hidden; border: 2px solid rgba(255,255,255,.12); border-radius: 28px; background: linear-gradient(145deg, rgba(31,32,40,.98), rgba(15,16,21,.98)); box-shadow: 0 18px 0 #08090c, 0 36px 80px rgba(0,0,0,.42); clip-path: none; }
.landing-console::before { height: 7px; background: linear-gradient(90deg, var(--green) 0 33%, var(--yellow) 33% 66%, var(--blue) 66%); }
.landing-console::after { display: none; }
.console-header { min-height: 66px; border-bottom: 1px solid rgba(255,255,255,.09); background: rgba(255,255,255,.025); }
.console-brand img { width: 36px; height: 36px; filter: drop-shadow(0 5px 8px rgba(0,0,0,.25)); }
.system-status { padding: 8px 13px; border-radius: 999px; color: var(--green); background: rgba(73,217,154,.08); }
.console-level { padding: 8px 13px; border: 0; border-radius: 999px; color: #13130d; background: var(--yellow); }
.console-body { min-height: 570px; }
.landing-copy { padding-left: 64px; }
.landing-copy::before { content: ''; position: absolute; width: 92px; height: 92px; right: 14%; top: 18%; border: 18px solid rgba(89,167,255,.08); border-radius: 50%; transform: rotate(-12deg); }
.landing-copy::after { right: -15px; bottom: -75px; color: rgba(73,217,154,.06); font-size: 320px; transform: rotate(-5deg); }
.landing-copy::before, .landing-copy::after { display: none; }
.landing-copy h1 { letter-spacing: -.065em; text-shadow: 0 7px 0 rgba(0,0,0,.24); }
.landing-copy h1 em { display: inline-block; transform: rotate(-1.5deg); color: var(--yellow); }
.mission-tags span { border: 0; border-radius: 999px; color: #c9ced8; background: rgba(255,255,255,.07); }
.mission-tags span:nth-child(1) { box-shadow: inset 0 0 0 1px rgba(73,217,154,.25); }
.mission-tags span:nth-child(2) { box-shadow: inset 0 0 0 1px rgba(243,211,91,.25); }
.mission-tags span:nth-child(3) { box-shadow: inset 0 0 0 1px rgba(89,167,255,.25); }
.size-picker { border-left-color: rgba(255,255,255,.08); background: linear-gradient(180deg, rgba(89,167,255,.08), rgba(73,217,154,.035)); }
.panel-heading { font-size: 13px; }
.panel-heading b { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: #14110a; background: var(--yellow); box-shadow: 0 6px 0 rgba(140,116,20,.55); }
.size-option { height: 118px; border: 2px solid rgba(255,255,255,.08); border-radius: 16px; background: linear-gradient(145deg, #292b35, #1a1b22); box-shadow: 0 7px 0 #0d0e12; clip-path: none; }
.size-option::after { display: none; }
.size-option:hover, .size-option:focus-visible { border-color: var(--blue); transform: translateY(-5px) rotate(-1deg); box-shadow: 0 12px 0 #0d0e12; }
.size-option:nth-child(even):hover { transform: translateY(-5px) rotate(1deg); }
.size-option.is-selected { border-color: var(--yellow); background: linear-gradient(145deg, rgba(243,211,91,.22), rgba(243,211,91,.075)); box-shadow: 0 7px 0 #78681f, 0 0 28px rgba(243,211,91,.12); transform: translateY(-2px); }
.size-picker .start-button { border: 0; border-radius: 16px; background: linear-gradient(135deg, #64e7a9, var(--green)); box-shadow: 0 8px 0 #16774f, 0 16px 28px rgba(0,0,0,.28); clip-path: none; }
.size-picker .start-button:hover { transform: translateY(-3px); box-shadow: 0 11px 0 #16774f, 0 19px 30px rgba(0,0,0,.32); }
.size-picker .start-button:active { transform: translateY(5px); box-shadow: 0 3px 0 #16774f; }
.button-label { transform: none !important; }
.console-footer { min-height: 48px; background: rgba(0,0,0,.13); }
.game-header { border: 2px solid rgba(255,255,255,.1); border-radius: 18px; background: rgba(25,26,33,.9); box-shadow: 0 8px 0 #090a0e, 0 18px 32px rgba(0,0,0,.2); clip-path: none; }
.hud-item { padding: 8px 13px; border: 0; border-radius: 12px; background: rgba(255,255,255,.045); }
.board-wrap { border: 2px solid rgba(255,255,255,.09); border-radius: 22px; background: rgba(17,18,24,.82); box-shadow: 0 10px 0 #08090c, inset 0 0 60px rgba(89,167,255,.025); clip-path: none; }
.board-topline { border-radius: 20px 20px 0 0; background: rgba(255,255,255,.025); }
.memory-card { border-radius: 13px; }
.card-face { border-radius: 13px; }
.card-back { border: 2px solid rgba(255,255,255,.13); border-radius: 13px; background: radial-gradient(circle at 25% 20%, rgba(243,211,91,.18) 0 3px, transparent 4px), radial-gradient(circle at 78% 74%, rgba(89,167,255,.18) 0 4px, transparent 5px), linear-gradient(145deg, #30333f, #20212a); background-size: 42px 42px, 54px 54px, 100% 100%; box-shadow: inset 0 0 0 5px #191a21, inset 0 0 0 7px rgba(73,217,154,.26), 0 9px 0 #090a0d; clip-path: none; }
.card-back::before { inset: 16px; border: 2px solid rgba(255,255,255,.12); border-radius: 18px; transform: rotate(0); }
.card-back::after { font-size: 54px; color: var(--green); transform: rotate(-4deg); }
.memory-card:hover:not(.is-hidden) { transform: translateY(-7px) rotate(-.6deg); filter: drop-shadow(0 17px 15px rgba(0,0,0,.34)); }
.memory-card:nth-child(even):hover:not(.is-hidden) { transform: translateY(-7px) rotate(.6deg); }
.game-footer { border-radius: 13px; }
.loading-panel { display: grid; grid-template-rows: 28px 1fr 5px 42px 62px; width: min(560px, 100%); height: min(420px, calc(100vh - 40px)); padding: 34px; overflow: hidden; border: 2px solid rgba(255,255,255,.1); border-radius: 24px; background: #111219; box-shadow: 0 12px 0 #07080b, 0 28px 90px rgba(0,0,0,.6); clip-path: none; }
.loading-panel > .eyebrow { grid-row: 1; margin: 0; }
.loading-copy { grid-row: 2; display: flex; align-items: center; min-height: 0; overflow: hidden; }
.loading-quote { max-width: 480px; font-size: clamp(22px, 3vw, 36px); line-height: 1.06; letter-spacing: -.035em; }
.loading-bar { grid-row: 3; margin-top: 0; }
.loading-status { grid-row: 4; margin: 12px 0 0; }
.loading-enter { grid-row: 5; align-self: start; display: grid; grid-template-columns: 1fr 52px; align-items: center; width: 100%; margin: 0; padding: 0; border: 0; border-radius: 16px; color: #07110d; background: linear-gradient(135deg, #64e7a9, var(--green)); box-shadow: 0 8px 0 #16774f, 0 16px 28px rgba(0,0,0,.28); }
.loading-enter:hover { padding-left: 0; color: #07110d; background: #70edb5; transform: translateY(-3px); box-shadow: 0 11px 0 #16774f, 0 19px 30px rgba(0,0,0,.32); }
.loading-enter span { color: #07110d; }
.level-icon { position: absolute; top: 13px; right: 14px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; color: currentColor; background: rgba(255,255,255,.06); font: 15px/1 'Space Grotesk', sans-serif; }
.size-option:nth-child(1) .level-icon { color: var(--yellow); }
.size-option:nth-child(2) .level-icon { color: var(--green); font-size: 11px; }
.size-option:nth-child(3) .level-icon { color: #ff7b7b; font-size: 13px; }
.size-option:nth-child(4) .level-icon { color: var(--blue); }
.mini-card-stack { position: relative; width: 54px; height: 42px; }
.mini-card-stack i { position: absolute; top: 3px; left: 13px; width: 27px; height: 36px; border: 2px solid rgba(255,255,255,.75); border-radius: 6px; background: linear-gradient(145deg, var(--blue), #2e63b1); box-shadow: 0 4px 0 rgba(0,0,0,.28); }
.mini-card-stack i::after { content: '♥'; position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.9); font: 12px/1 sans-serif; }
.mini-card-stack i:first-child { transform: translateX(-8px) rotate(-10deg); animation: cardShuffleLeft 2.4s ease-in-out infinite; }
.mini-card-stack i:last-child { background: linear-gradient(145deg, var(--green), #20835c); transform: translateX(8px) rotate(10deg); animation: cardShuffleRight 2.4s ease-in-out infinite; }
.mini-card-stack i:last-child::after { content: '∞'; font-size: 15px; }
.home-header { flex: 0 0 auto; width: 100%; margin-bottom: 22px; }
.card-back::after { display: none; }
.card-back-icon { position: relative; z-index: 1; width: min(48%, 78px); height: auto; filter: drop-shadow(0 8px 12px rgba(0,0,0,.35)); transform: rotate(-3deg); transition: transform .3s cubic-bezier(.2,.8,.2,1); }
.memory-card:hover:not(.is-hidden) .card-back-icon { transform: rotate(3deg) scale(1.08); }
@keyframes playfulFloat { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-9px) rotate(12deg); } }
@keyframes quoteInStay { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes cardShuffleLeft { 0%, 100% { transform: translateX(-8px) translateY(1px) rotate(-10deg); } 50% { transform: translateX(-3px) translateY(-4px) rotate(-4deg); } }
@keyframes cardShuffleRight { 0%, 100% { transform: translateX(8px) translateY(-1px) rotate(10deg); } 50% { transform: translateX(3px) translateY(4px) rotate(4deg); } }

@media (max-width: 540px) { .landing-console { border-radius: 18px; clip-path: none; } .landing-copy { padding-left: 24px; } .landing-console::after { top: 76px; right: 18px; font-size: 24px; } .size-option { border-radius: 13px; } .home-header { padding: 12px 14px; } .game-header .brand { gap: 7px; font-size: 12px; } .home-header .brand-icon { width: 29px; height: 30px; } }

/* Adult, heavier game direction */
body { background: radial-gradient(circle at 50% -20%, #202229 0, #101115 42%, #07080a 100%); }
body::before { opacity: .18; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 36px 36px; }
.landing-console { border: 1px solid rgba(255,255,255,.16); border-radius: 4px; background: linear-gradient(145deg, #1a1b20, #0c0d10); box-shadow: 14px 14px 0 #050608, 0 38px 100px rgba(0,0,0,.58); }
.landing-console::before { height: 4px; opacity: .78; }
.console-body { min-height: 590px; }
.landing-copy { border-right: 1px solid rgba(255,255,255,.1); }
.landing-copy h1 { font-weight: 700; text-shadow: 0 9px 0 rgba(0,0,0,.45); }
.landing-copy h1 em { transform: none; color: #e2c54e; }
.landing-intro { color: #a3a1a0; }
.mission-tags span { padding: 6px 9px; border-radius: 2px; color: #9a9ca4; background: #17181d; box-shadow: inset 0 0 0 1px rgba(255,255,255,.1) !important; }
.size-picker { border-left: 0; background: linear-gradient(180deg, rgba(255,255,255,.025), rgba(0,0,0,.18)); }
.panel-heading { border-bottom-color: rgba(255,255,255,.18); font-weight: 700; }
.size-option { height: 112px; border: 1px solid #383a42; border-radius: 3px; background: linear-gradient(145deg, #222329, #15161a); box-shadow: 7px 7px 0 #090a0c; }
.size-option:hover, .size-option:focus-visible, .size-option:nth-child(even):hover { border-color: #777a84; transform: translateY(-3px); box-shadow: 9px 9px 0 #07080a; }
.size-option.is-selected { border-color: #d6bb4d; background: linear-gradient(145deg, rgba(214,187,77,.17), #171715); box-shadow: 7px 7px 0 #5d5123; transform: none; }
.level-icon { border-radius: 2px; background: #0f1013; box-shadow: inset 0 0 0 1px rgba(255,255,255,.09); }
.size-picker .start-button, .loading-enter { border-radius: 3px; background: #2f946b; box-shadow: 7px 7px 0 #0d4931; }
.size-picker .start-button:hover, .loading-enter:hover { background: #3ca67b; transform: translateY(-2px); box-shadow: 9px 9px 0 #0d4931; }
.size-picker .start-button:active { transform: translateY(4px); box-shadow: 3px 3px 0 #0d4931; }
.mini-card-stack i { border: 1px solid rgba(255,255,255,.6); border-radius: 2px; background: #2e5f96; box-shadow: 4px 4px 0 #08090b; }
.mini-card-stack i:first-child { animation: cardShuffleLeft 4s ease-in-out infinite; }
.mini-card-stack i:last-child { background: #276b50; animation: cardShuffleRight 4s ease-in-out infinite; }
.mini-card-stack i::after { content: '01'; color: rgba(255,255,255,.72); font: 8px 'DM Mono', monospace; }
.mini-card-stack i:last-child::after { content: '02'; font-size: 8px; }
.console-footer { border-top-color: rgba(255,255,255,.14); background: #0b0c0f; }
.console-footer span:last-child { color: var(--yellow); }
.game-header { border: 1px solid rgba(255,255,255,.15); border-radius: 3px; background: #16171c; box-shadow: 8px 8px 0 #07080a; }
.hud-item { border-radius: 2px; background: #0d0e11; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.board-wrap { border: 1px solid rgba(255,255,255,.14); border-radius: 3px; background: #101115; box-shadow: 10px 10px 0 #060709, inset 0 0 80px rgba(0,0,0,.26); }
.board-topline { border-radius: 0; background: #0b0c0f; }
.memory-card, .card-face { border-radius: 4px; }
.card-back { border: 1px solid rgba(255,255,255,.16); border-radius: 4px; background: linear-gradient(145deg, #2a2b31, #16171b); box-shadow: inset 0 0 0 5px #111216, inset 0 0 0 6px rgba(73,217,154,.18), 0 8px 0 #050608; }
.card-back::before { border-radius: 2px; border-color: rgba(255,255,255,.1); }
.card-back-icon { opacity: .82; backface-visibility: hidden; -webkit-backface-visibility: hidden; filter: grayscale(1) saturate(0) brightness(.82) contrast(1.08) drop-shadow(0 8px 12px rgba(0,0,0,.5)); transform: translateZ(1px); transition: opacity .12s ease .28s, transform .3s cubic-bezier(.2,.8,.2,1); }
.memory-card.is-flipped .card-back-icon { opacity: 0; transition-delay: .25s; }
.memory-card:hover:not(.is-hidden), .memory-card:nth-child(even):hover:not(.is-hidden) { transform: translateY(-5px); filter: drop-shadow(0 17px 12px rgba(0,0,0,.5)); }
.memory-card:hover:not(.is-hidden) .card-back-icon { transform: scale(1.04); }
.game-footer { border-radius: 2px; background: #0d0e11; }
.loading-panel { border: 1px solid rgba(255,255,255,.16); border-radius: 3px; background: #111216; box-shadow: 12px 12px 0 #050608, 0 35px 100px rgba(0,0,0,.68); }

@media (max-width: 540px) { .landing-console { border-radius: 3px; } .size-option { border-radius: 3px; } }

/* Investigative editorial direction */
:root { --ink: #f1eee5; --paper: #090909; --card: #151515; --line: rgba(241,238,229,.22); --green: #287b58; --yellow: #edcf43; --blue: #4d84ad; }
body { background: #090909; }
body::before { opacity: .22; background-image: repeating-linear-gradient(0deg, transparent 0 7px, rgba(255,255,255,.025) 8px); background-size: 100% 8px; }
.landing-page { padding: 24px 0 42px; }
.game-header, .home-header { position: sticky; z-index: 20; top: 0; margin-bottom: 18px; padding: 16px 0 14px; border: 0; border-bottom: 5px solid var(--yellow); border-radius: 0; background: rgba(9,9,9,.96); box-shadow: none; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.brand { font-family: 'Space Grotesk', sans-serif; font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.game-back { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 8px; padding: 9px 11px; border: 1px solid var(--line); color: #aaa69e; background: #111; font: 500 9px 'DM Mono', monospace; letter-spacing: .12em; text-decoration: none; transition: color .2s ease, border-color .2s ease, background .2s ease; }
.game-back span { color: var(--yellow); font-size: 15px; line-height: 1; }
.game-back:hover, .game-back:focus-visible { border-color: var(--yellow); color: var(--ink); background: #181818; outline: none; }
.brand-icon { width: 42px; height: 42px; }
.landing-console { overflow: visible; border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0; background: #101010; box-shadow: none; }
.landing-console::before { top: -1px; right: auto; width: 120px; height: 8px; background: var(--green); opacity: 1; }
.console-body { grid-template-columns: minmax(0, 1.35fr) minmax(360px, .65fr); min-height: 610px; }
.landing-copy { padding: 74px 6vw 68px 48px; border-right: 1px solid var(--line); }
.landing-copy .eyebrow { max-width: 520px; margin-bottom: 26px; color: var(--yellow); font-size: 12px; font-weight: 500; letter-spacing: .08em; }
.landing-copy h1 { max-width: 700px; margin-bottom: 34px; font-size: clamp(70px, 8.5vw, 126px); font-weight: 700; line-height: .79; letter-spacing: -.08em; text-shadow: none; }
.landing-copy h1 em { display: inline-block; margin-top: 9px; padding: 2px 10px 7px; color: #090909; background: var(--yellow); }
.landing-intro { max-width: 590px; margin-bottom: 36px; color: #c2bfb7; font-size: 20px; line-height: 1.42; }
.mission-tags { gap: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.mission-tags span { padding: 10px 16px 10px 0; margin-right: 16px; border: 0; border-radius: 0; color: #a8a59f; background: transparent; box-shadow: none !important; }
.mission-tags span:not(:last-child)::after { content: '/'; padding-left: 16px; color: var(--yellow); }
.size-picker { padding: 48px 36px; border: 0; background: #151515; }
.panel-heading { margin-bottom: 28px; padding-bottom: 16px; border-bottom: 5px solid var(--ink); font-family: 'Space Grotesk', sans-serif; font-size: 19px; font-weight: 700; letter-spacing: -.03em; }
.picker-label { color: #86837e; font-size: 9px; }
.size-options { gap: 1px; background: rgba(255,255,255,.16); }
.size-option { height: 104px; padding: 14px; border: 0; border-top: 4px solid transparent; border-radius: 0; color: #8f8c86; background: #111; box-shadow: none; }
.size-option:hover, .size-option:focus-visible, .size-option:nth-child(even):hover { border-color: var(--blue); color: var(--ink); background: #1b1b1b; transform: none; box-shadow: none; }
.size-option.is-selected { border-color: var(--yellow); color: var(--yellow); background: #202018; box-shadow: none; transform: none; }
.size-option strong { font-family: 'Space Grotesk', sans-serif; font-size: 34px; font-weight: 700; }
.level-icon { top: 12px; right: 12px; width: auto; height: auto; border-radius: 0; color: #777 !important; background: transparent; box-shadow: none; }
.size-option.is-selected .level-icon { color: var(--yellow) !important; }
.mini-card-stack { width: 48px; }
.mini-card-stack i { border: 1px solid rgba(255,255,255,.5); border-radius: 0; box-shadow: 3px 3px 0 #000; }
.size-picker .start-button, .loading-enter { border: 0; border-radius: 0; color: #07100b; background: var(--green); box-shadow: none; }
.size-picker .start-button:hover, .loading-enter:hover { color: #050a07; background: #329a70; transform: none; box-shadow: none; }
.size-picker .start-button:active { transform: translateY(2px); box-shadow: none; }
.button-label { font-family: 'Space Grotesk', sans-serif !important; font-size: 13px !important; font-weight: 700; letter-spacing: .06em; }
.console-footer { min-height: 46px; padding: 0; border-top: 1px solid var(--line); background: #090909; }
.console-footer span { padding: 0 16px; }
.console-footer span:first-child { padding-left: 0; color: var(--yellow); }
.game-header h1 { font-weight: 700; letter-spacing: -.055em; }
.header-divider { background: rgba(241,238,229,.3); }
.hud-item { padding: 0 0 0 15px; border-left: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; }
.board-wrap { padding: 42px 18px 18px; border: 1px solid rgba(241,238,229,.14); border-radius: 0; background: #111; box-shadow: none; }
.board-topline { height: 34px; padding: 0; border-radius: 0; color: #77736c; background: transparent; }
.board-topline span:first-child { color: var(--yellow); }
.board { gap: 12px; }
.memory-card, .card-face { border-radius: 0; }
.memory-card { transition: opacity .45s ease, transform .35s ease, filter .35s ease; }
.card-back { border: 1px solid #484848; border-radius: 0; background: #242424; box-shadow: inset 0 0 0 5px #161616, 0 6px 0 #030303; }
.card-back::before { inset: 14px; border: 1px solid rgba(255,255,255,.12); border-radius: 0; }
.card-back-icon { width: min(45%, 72px); opacity: .62; filter: grayscale(1) brightness(.68) contrast(1.2); }
.memory-card:hover:not(.is-hidden), .memory-card:nth-child(even):hover:not(.is-hidden) { transform: translateY(-4px); filter: drop-shadow(0 12px 8px rgba(0,0,0,.58)); }
.card-front { border-color: rgba(255,255,255,.3); }
.memory-card.has-image .card-front h3, .card-front h3 { padding: 13px 16px 15px; border-top: 4px solid var(--yellow); background: rgba(8,8,8,.91); box-shadow: none; backdrop-filter: blur(4px); font-weight: 700; }
.game-footer { margin-top: 14px; padding: 12px 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
.loading-panel { border: 0; border-top: 8px solid var(--yellow); border-radius: 0; background: #111; box-shadow: 14px 14px 0 #000; }
.loading-quote { font-weight: 700; letter-spacing: -.045em; }
.card-modal, .win-message { border: 0; border-top: 8px solid var(--yellow); border-radius: 0; background: #121212; box-shadow: 14px 14px 0 #000, 0 30px 90px rgba(0,0,0,.65); }
.card-modal.modal-has-image .modal-hero h2 { border: 0; border-left: 6px solid var(--yellow); border-radius: 0; background: rgba(5,5,5,.9); box-shadow: none; }
.modal-hero { position: relative; }
.card-modal.modal-has-image .modal-hero { margin-top: -34px; }
.modal-close { z-index: 4; top: 14px; right: 14px; border-radius: 50%; color: var(--ink); background: rgba(5,5,5,.76); backdrop-filter: blur(5px); }
.modal-close:hover:not(:disabled) { color: var(--yellow); background: rgba(5,5,5,.92); }
.modal-close:disabled { color: #777; background: rgba(5,5,5,.76); }

@media (max-width: 900px) { .console-body { grid-template-columns: 1fr; } .landing-copy { border-right: 0; border-bottom: 1px solid var(--line); } }
@media (max-width: 540px) { .landing-console, .size-option, .game-header, .board-wrap, .loading-panel { border-radius: 0; } .landing-copy { padding: 52px 22px 46px; } .landing-copy h1 { font-size: clamp(58px, 19vw, 82px); } .landing-intro { font-size: 17px; } .size-picker { padding: 34px 20px 40px; } .card-modal.modal-has-image .modal-hero { margin-top: -26px; } }

@media (max-width: 600px) {
  .game-shell { width: calc(100% - 14px); padding: 10px 0 18px; }
  .game-header { gap: 10px; margin-bottom: 12px; padding: 10px 0 11px; }
  .game-header h1 { flex-basis: 100%; order: 3; font-size: 20px; }
  .game-back { padding: 8px; font-size: 0; }
  .game-back span { font-size: 17px; }
  .game-hud { margin-left: auto; }
  .hud-item { padding-left: 10px; }
  .hud-item strong { font-size: 17px; }
  .board-wrap { padding: 34px 6px 10px; }
  .board-topline { height: 28px; padding: 0 3px; }
  .board { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .memory-card { min-width: 0; min-height: 0; aspect-ratio: .69; }
  .card-front { padding: 6px; }
  .card-front h3, .memory-card.has-image .card-front h3 { max-height: none; padding: 7px 6px 8px; overflow: visible; font-size: clamp(9.5px, 3vw, 11px); line-height: 1.05; letter-spacing: -.025em; }
  .card-back::before { inset: 8px; }
  .card-back-icon { width: min(44%, 48px); }
  .game-footer { padding: 10px 2px; }
}

/* Sources and image credits */
.sources-nav-link, .sources-back { margin-left: auto; color: #aaa69e; font: 500 9px/1 'DM Mono', monospace; letter-spacing: .1em; text-decoration: none; text-transform: uppercase; }
.sources-nav-link span, .sources-back span { margin-left: 8px; color: var(--yellow); font-size: 14px; }
.sources-nav-link:hover, .sources-nav-link:focus-visible, .sources-back:hover, .sources-back:focus-visible { color: var(--yellow); outline: none; }
.board-topline a { color: #77736c; text-decoration: none; }
.board-topline a:hover, .board-topline a:focus-visible { color: var(--yellow); outline: none; }
.sources-page { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 16px 0 70px; }
.sources-header { position: sticky; z-index: 20; top: 0; margin-bottom: 0; background: rgba(9,9,9,.94); backdrop-filter: blur(14px); }
.sources-intro { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr); gap: 30px; align-items: end; padding: 82px 0 58px; border-bottom: 1px solid var(--line); }
.sources-intro .eyebrow { grid-column: 1 / -1; margin: 0; color: var(--yellow); }
.sources-intro h1 { margin: 0; color: var(--ink); font: 700 clamp(68px, 10vw, 132px)/.76 'Space Grotesk', sans-serif; letter-spacing: -.085em; }
.sources-intro h1 em { color: var(--yellow); font-style: normal; }
.sources-intro > p:last-child { max-width: 430px; margin: 0 0 4px; color: #aaa69e; font: 500 16px/1.5 'Space Grotesk', sans-serif; }
.sources-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; padding-top: 24px; }
.source-entry { display: grid; grid-template-columns: 145px minmax(0, 1fr); min-height: 430px; border: 1px solid var(--line); background: #0e0e0e; }
.source-images { display: grid; grid-template-rows: repeat(2, minmax(0, 1fr)); min-height: 100%; border-right: 1px solid var(--line); }
.source-images.is-single { grid-template-rows: minmax(0, 1fr); }
.source-image { position: relative; min-height: 0; margin: 0; overflow: hidden; background: #171717; }
.source-image + .source-image { border-top: 1px solid var(--line); }
.source-image::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 45%, rgba(0,0,0,.72)); pointer-events: none; }
.source-image img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.72) contrast(1.06); }
.source-image figcaption { position: absolute; z-index: 2; right: 8px; bottom: 8px; padding: 4px 5px; color: var(--ink); background: rgba(5,5,5,.78); font: 500 7px/1 'DM Mono', monospace; letter-spacing: .12em; text-transform: uppercase; }
.source-entry-body { display: flex; min-width: 0; flex-direction: column; padding: 24px 22px 22px; }
.source-entry-index { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--source-accent); font: 600 10px/1 'DM Mono', monospace; letter-spacing: .1em; text-transform: uppercase; }
.source-entry-index small { overflow: hidden; color: #77736c; font: inherit; text-overflow: ellipsis; white-space: nowrap; }
.source-entry h2 { margin: 18px 0 28px; color: var(--ink); font: 700 clamp(23px, 2.4vw, 34px)/.98 'Space Grotesk', sans-serif; letter-spacing: -.05em; }
.source-group { margin-top: auto; }
.source-group h3, .source-credit > span { display: block; margin: 0 0 10px; color: #77736c; font: 500 8px/1 'DM Mono', monospace; letter-spacing: .14em; text-transform: uppercase; }
.source-group ol { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.source-group a, .source-credit a { display: flex; justify-content: space-between; gap: 12px; color: #bcb8af; font: 500 11px/1.35 'DM Mono', monospace; text-decoration: none; }
.source-group a span, .source-credit a span { flex: 0 0 auto; color: var(--yellow); }
.source-group a:hover, .source-group a:focus-visible, .source-credit a:hover, .source-credit a:focus-visible { color: var(--yellow); outline: none; }
.source-credit { margin-top: 22px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.09); }
.sources-footer { display: flex; justify-content: space-between; gap: 30px; padding: 28px 0 0; color: #77736c; font: 500 9px/1.5 'DM Mono', monospace; letter-spacing: .08em; text-transform: uppercase; }
.sources-footer p { max-width: 620px; margin: 0; }
.sources-footer a { flex: 0 0 auto; color: var(--ink); text-decoration: none; }
.sources-footer a span { margin-left: 8px; color: var(--yellow); }

@media (max-width: 820px) {
  .sources-page { width: calc(100% - 24px); }
  .sources-intro { grid-template-columns: 1fr; padding: 54px 0 40px; }
  .sources-intro .eyebrow { grid-column: auto; }
  .sources-intro h1 { font-size: clamp(65px, 18vw, 105px); }
  .sources-grid { grid-template-columns: 1fr; gap: 18px; padding-top: 18px; }
  .source-entry { grid-template-columns: 120px minmax(0, 1fr); min-height: 390px; }
}

@media (max-width: 520px) {
  .sources-nav-link { font-size: 0; }
  .sources-nav-link::before { content: 'FONTES'; font-size: 8px; }
  .sources-header .sources-back { font-size: 0; }
  .sources-header .sources-back::before { content: 'INÍCIO'; font-size: 8px; }
  .sources-intro { gap: 22px; padding-top: 42px; }
  .sources-intro > p:last-child { font-size: 15px; }
  .sources-grid { gap: 14px; padding-top: 14px; }
  .source-entry { grid-template-columns: 92px minmax(0, 1fr); min-height: 410px; }
  .source-entry-body { padding: 20px 15px 18px; }
  .source-entry h2 { margin: 16px 0 24px; font-size: 24px; }
  .source-group a, .source-credit a { font-size: 10px; }
  .sources-footer { flex-direction: column; }
}

@media (max-width: 350px) {
  .board { gap: 4px; }
  .card-front h3, .memory-card.has-image .card-front h3 { max-height: none; font-size: 9px; }
}

.game-footer { flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 14px; }
.game-actions { display: grid; gap: 8px; width: 220px; margin: 0; }
.restart-button, .game-footer .game-back { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 40px; padding: 10px 12px; border: 1px solid var(--line); color: #aaa69e; background: #121212; cursor: pointer; font: 500 9px 'DM Mono', monospace; letter-spacing: .1em; text-align: left; text-decoration: none; text-transform: uppercase; transition: color .2s ease, border-color .2s ease, background .2s ease; }
.restart-button span, .game-footer .game-back span { padding: 0; color: var(--yellow); font-size: 16px; line-height: 1; }
.restart-button:hover, .game-footer .game-back:hover, .game-footer .game-back:focus-visible { border-color: var(--yellow); color: var(--ink); background: #1a1a1a; outline: none; }

@media (max-width: 600px) {
  .game-footer { align-items: flex-start; }
  .game-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; margin-left: 0; }
  .game-footer .game-back { padding: 10px 12px; font-size: 9px; }
  .game-actions span { display: inline-grid !important; place-items: center; }
}

/* Continuous pair selector */
.pair-slider { padding: 18px 0 8px; }
.pair-slider-value { display: flex; align-items: flex-end; gap: 13px; margin-bottom: 24px; }
.pair-slider-value > strong { color: var(--yellow); font: 700 66px/.78 'Space Grotesk', sans-serif; letter-spacing: -.07em; }
.pair-slider-value > span { display: grid; gap: 3px; padding-bottom: 1px; }
.pair-slider-value b { color: var(--ink); font: 700 16px/1 'Space Grotesk', sans-serif; letter-spacing: .08em; }
.pair-slider-value small, .pair-slider-scale { color: #77736c; font: 500 8px/1 'DM Mono', monospace; letter-spacing: .12em; }
#pairCountSlider { width: 100%; height: 8px; margin: 0; border: 0; border-radius: 0; appearance: none; background: linear-gradient(to right, var(--yellow) 0 var(--range-progress, 0%), #373737 var(--range-progress, 0%) 100%); cursor: pointer; }
#pairCountSlider::-webkit-slider-thumb { width: 25px; height: 25px; border: 5px solid #111; border-radius: 50%; appearance: none; background: var(--yellow); box-shadow: 0 0 0 1px var(--yellow); }
#pairCountSlider::-moz-range-thumb { width: 15px; height: 15px; border: 5px solid #111; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 1px var(--yellow); }
#pairCountSlider:focus-visible { outline: 2px solid var(--blue); outline-offset: 8px; }
.pair-slider-scale { display: flex; justify-content: space-between; margin-top: 12px; }

/* Viewport-fitted game board */
.game-shell:not([hidden]) { display: flex; flex-direction: column; width: min(1220px, calc(100% - 40px)); height: 100dvh; min-height: 0; padding: 16px 0 12px; overflow: hidden; }
.game-shell .game-header { flex: 0 0 auto; margin-bottom: 9px; }
.game-shell .board-wrap { display: flex; flex: 1 1 auto; min-height: 0; flex-direction: column; padding: 38px 10px 9px; overflow: hidden; }
.game-shell .board { flex: 1 1 auto; min-height: 0; grid-template-columns: repeat(var(--board-columns, 5), minmax(0, 1fr)); grid-template-rows: repeat(var(--board-rows, 2), minmax(0, 1fr)); gap: clamp(4px, .75vw, 10px); }
.game-shell .memory-card { align-self: center; justify-self: center; width: var(--fitted-card-width, 100%); height: var(--fitted-card-height, 100%); min-width: 0; min-height: 0; aspect-ratio: .7; }
.memory-card.has-image .card-front::after { background-image: var(--card-image); filter: saturate(.82) contrast(1.06); }
.card-front::before { display: none; }
.game-shell .game-footer { flex: 0 0 auto; gap: 8px; margin-top: 8px; padding-top: 8px; }
.game-shell .game-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(440px, 100%); }

@media (max-width: 600px) {
  .pair-slider-value > strong { font-size: 58px; }
  .game-shell:not([hidden]) { width: calc(100% - 10px); padding: 6px 0; }
  .game-shell .game-header { gap: 7px; margin-bottom: 6px; padding: 6px 0 7px; }
  .game-shell .game-header h1 { margin: 0; font-size: 16px; line-height: 1; }
  .game-shell .board-wrap { padding: 29px 3px 5px; }
  .game-shell .board-topline { height: 25px; font-size: 7px; }
  .game-shell .board { grid-template-columns: repeat(var(--board-columns, 5), minmax(0, 1fr)); gap: 4px; }
  .game-shell .card-back { box-shadow: inset 0 0 0 3px #161616, 0 3px 0 #030303; }
  .game-shell .card-back::before { inset: 5px; }
  .game-shell .card-back-icon { width: min(42%, 34px); }
  .game-shell .game-footer { margin-top: 5px; padding: 5px 0 0; }
  .game-shell .game-actions { gap: 5px; }
  .game-shell .restart-button, .game-shell .game-back { min-height: 34px; padding: 7px 8px; font-size: 8px; }
}

/* Completion modal */
.win-backdrop { z-index: 60; }
.win-message { position: relative; padding: 42px; overflow: hidden; }
.win-message::after { content: 'MEMÓRIA'; position: absolute; z-index: 0; right: -10px; bottom: 72px; color: rgba(241,238,229,.035); font: 700 92px/1 'Space Grotesk', sans-serif; letter-spacing: -.08em; pointer-events: none; }
.win-message > * { position: relative; z-index: 1; }
.win-message .eyebrow { margin: 0; color: var(--yellow); font-size: 10px; letter-spacing: .11em; }
.win-message h2 { margin: 30px 0 28px; color: var(--ink); }
.win-message h2 em { display: inline-block; margin-top: 8px; padding: 2px 9px 7px; color: #090909; background: var(--yellow); font-style: normal; }
.win-message .win-lead { max-width: 470px; margin: 0; color: var(--ink); font: 700 clamp(20px, 3.2vw, 29px)/1.12 'Space Grotesk', sans-serif; letter-spacing: -.035em; }
.win-message .win-reminder { max-width: none; margin: 30px 0 0; padding: 13px 0 13px 16px; border-left: 5px solid var(--green); color: #aaa69e; font: 500 12px/1.4 'DM Mono', monospace; letter-spacing: .04em; text-transform: uppercase; }
.win-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 34px; }
.win-action { display: flex; justify-content: space-between; align-items: center; min-height: 48px; padding: 12px 14px; border: 1px solid var(--line); color: var(--ink); background: #191919; cursor: pointer; font: 500 10px/1.25 'DM Mono', monospace; letter-spacing: .08em; text-align: left; text-decoration: none; text-transform: uppercase; transition: border-color .2s ease, background .2s ease, color .2s ease; }
.win-action:first-child { border-color: var(--green); background: var(--green); }
.win-action:hover, .win-action:focus-visible { border-color: var(--yellow); color: var(--yellow); background: #202018; outline: none; }
.win-action span:last-child { flex: 0 0 auto; margin-left: 10px; color: var(--yellow); font-size: 17px; }
.win-action:first-child span:last-child { color: #07100b; }
.win-action:first-child:hover span:last-child, .win-action:first-child:focus-visible span:last-child { color: var(--yellow); }

@media (max-width: 520px) {
  .win-backdrop { padding: 14px; }
  .win-message { padding: 30px 22px 24px; }
  .win-message h2 { font-size: clamp(50px, 18vw, 72px); }
  .win-message .win-lead { font-size: 20px; }
  .win-actions { grid-template-columns: 1fr; }
}

/* iOS and small-screen modal viewport safety */
@media (max-width: 600px) {
  .modal-backdrop {
    place-items: start center;
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    padding-top: max(12px, env(safe-area-inset-top));
    padding-right: max(12px, env(safe-area-inset-right));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    padding-left: max(12px, env(safe-area-inset-left));
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .card-modal {
    width: 100%;
    max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .card-modal.modal-has-image .modal-hero {
    margin-top: -26px;
  }

  .modal-close {
    top: 10px;
    right: 10px;
  }
}
