:root {
  --game-surface: var(--research-surface);
  --game-subtle: var(--research-subtle);
  --game-image: var(--research-surface);
  --game-text: var(--research-text);
  --game-muted: var(--research-muted);
  --game-border: var(--research-border);
  --game-primary: var(--research-accent);
  --game-primary-text: var(--research-accent-text);
  --game-primary-hover: #53541b;
  --game-nav: #dfdba3;
  --game-accent: var(--research-accent);
  --game-profit: #286130;
  --game-loss: #a02b22;
  --game-focus: var(--research-focus);
}

#rakenne.homepage { width: min(1180px, calc(100% - 48px)); margin: 24px auto; padding: 0; }
.homepage #ylaosa { background: var(--game-surface); height: auto; min-height: 76px; display: grid; grid-template-columns: auto 1fr auto; gap: 8px 24px; align-items: center; padding: 12px 20px; box-sizing: border-box; }
.homepage #ylaosa h1 { padding: 0; margin: 0; line-height: 1; }
.homepage #ylaosa h1 img { display: block; width: 230px; height: auto; }
.homepage #ylaosa ul { display: flex; flex-wrap: wrap; background: var(--game-nav); padding: 0 12px; font: bold 13px 'Times New Roman', Times, serif; justify-content: center; gap: 18px; }
.homepage #ylaosa li { display: block; }
.homepage #ylaosa ul a { float: none; width: auto; height: auto; display: block; padding: 8px 0; background: none; border: none; margin: 0; color: var(--game-text); }
.homepage #ylaosa form { position: static; display: flex; align-items: center; gap: 4px; background: none; padding: 0; font-size: 13px; border: none; }
.homepage #ylaosa input { width: 130px; min-width: 0; max-width: 130px; padding: 8px; margin: 0; font-size: 13px; border: 1px solid var(--game-border); background: var(--game-surface); border-radius: 3px; }
.homepage #ylaosa button { font-size: 13px; margin: 0; padding: 8px 6px; border: 1px solid var(--game-border); border-radius: 3px; color: var(--game-text); background: var(--game-subtle); }
.homepage #ylaosa p { position: static; grid-column: 1 / -1; padding: 0; background: none; margin: 0; font-size: 13px; text-align: right; line-height: 1; display: block; }
.homepage #ylaosa p a { float: none; display: inline; width: auto; padding: 0; }
.homepage #keskiosa { background: var(--game-surface); padding: 30px 26px; margin-top: 20px; border-top: 1px solid var(--game-border); }
.homepage #sisalto { width: calc(100% - 242px); margin: 0; }
.homepage #sivupalkki { width: 200px; margin: 0; }
.homepage #alaosa { background: var(--game-nav); height: auto; }
.homepage #alaosa dl { padding: 24px 10px; }
.antique-game { background: var(--game-surface); color: var(--game-text); border-top: 1px solid var(--game-border); font: 16px/1.5 Arial, Helvetica, sans-serif; letter-spacing: 0; }
.antique-game *, .antique-game *::before, .antique-game *::after { box-sizing: border-box; letter-spacing: 0; }
.antique-game h2, .antique-game h3, .antique-game h4, .antique-game p, .antique-game label, .antique-game blockquote { padding: 0; margin: 0; float: none; width: auto; font: inherit; line-height: 1.5; }
.antique-game h2, .antique-game h3, .antique-game h4 { font-family: Arial, Helvetica, sans-serif; font-weight: 700; }
.antique-game a { color: var(--game-text); display: inline-flex; align-items: center; gap: 5px; text-decoration: underline; }
.antique-game a:hover { text-decoration: underline; }
.antique-game button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; min-height: 38px; border-radius: 4px; border: 1px solid transparent; background: transparent; color: var(--game-text); font: 600 14px/1.3 Arial, sans-serif; cursor: pointer; white-space: normal; transition: background .15s; }
.antique-game button:disabled { opacity: .5; cursor: not-allowed; }
.antique-game button:focus-visible, .antique-game input:focus-visible, .antique-game a:focus-visible { outline: 2px solid var(--game-focus); outline-offset: 3px; }
.antique-game svg { flex-shrink: 0; vertical-align: middle; }
.game-heading { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 20px; align-items: center; padding: 16px 28px; background: var(--game-subtle); }
.game-eyebrow { color: var(--game-muted); font: bold 12px/1.4 Arial, sans-serif; display: inline-flex; align-items: center; gap: 7px; }
.game-eyebrow > span, .game-live-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--game-primary); }
.antique-game h2 { font-size: 32px; line-height: 1.3; margin-top: 5px; }
.antique-game h2 .game-title-dot { display: inline; color: var(--game-accent); font-size: inherit; }
.game-mode { display: flex; background: var(--game-subtle); padding: 3px; border: 1px solid var(--game-border); border-radius: 4px; flex-shrink: 0; }
.game-mode button { min-width: 90px; min-height: 34px; }
.game-mode .is-active { background: var(--game-surface); border-color: var(--game-border); }
.game-toolbar { display: flex; align-items: stretch; justify-content: space-between; border-top: 1px solid var(--game-border); border-bottom: 1px solid var(--game-border); padding: 0 28px; min-height: 58px; gap: 15px; }
.game-tabs { display: flex; align-items: stretch; gap: 20px; }
.game-tabs button { border-radius: 0; padding: 0 2px; min-height: 58px; color: var(--game-muted); border-bottom: 2px solid transparent; }
.game-tabs button.is-active { border-bottom-color: var(--game-primary); color: var(--game-text); }
.game-count { display: inline-block; padding: 1px 6px; min-width: 20px; border-radius: 3px; background: var(--game-subtle); border: 1px solid var(--game-border); font-size: 13px; }
.game-wallet { display: flex; align-items: center; gap: 12px; border-left: 1px solid var(--game-border); padding-left: 24px; }
.game-wallet span { font-size: 13px; color: var(--game-muted); }
.game-wallet strong { display: block; font: 600 22px/1.2 Arial, sans-serif; color: var(--game-text); font-variant-numeric: tabular-nums; }
.game-roundline { padding: 14px 28px 10px; display: flex; justify-content: space-between; gap: 12px; color: var(--game-muted); font-size: 13px; }
.game-roundline b { color: var(--game-text); margin-left: 10px; }
.game-roundline .game-live-dot { margin-right: 6px; }
.game-deal-layout { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); gap: 30px; padding: 0 28px 20px; }
.game-object { min-width: 0; display: flex; flex-direction: column; background: var(--game-image); border: 1px solid var(--game-border); }
.game-object-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; font-size: 13px; color: var(--game-muted); }
.game-object-top > span:first-child { display: inline-flex; align-items: center; gap: 6px; color: var(--game-text); font-size: 13px; }
.game-object-image { display: block; height: 300px; width: 100%; object-fit: contain; padding: 12px 24px 18px; }
.game-object-bottom { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--game-border); color: var(--game-muted); font-size: 13px; background: var(--game-subtle); }
.game-object-bottom > span { display: flex; align-items: center; gap: 6px; }
.game-image-error { height: 330px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; color: var(--game-muted); }
.game-trade { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.game-seller { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 9px; margin-bottom: 12px; }
.game-avatar { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: 4px; background: var(--game-subtle); border: 1px solid var(--game-border); font: bold 16px Arial, sans-serif; }
.game-seller strong { display: block; font-size: 13px; }
.game-seller div > span { font-size: 13px; color: var(--game-muted); }
.antique-game h3 { font-size: 25px; line-height: 1.3; }
.game-trade blockquote { font-size: 16px; line-height: 1.7; color: var(--game-muted); margin: 12px 0 18px; padding-left: 14px; border-left: 2px solid var(--game-border); }
.game-asking { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--game-border); border-bottom: 1px solid var(--game-border); padding: 14px 0; margin-bottom: 14px; }
.game-asking > span:first-child { color: var(--game-muted); font-size: 13px; }
.game-asking strong { font-size: 25px; font-variant-numeric: tabular-nums; margin-left: auto; }
.game-asking-note { width: 100%; text-align: right; font-size: 13px; color: var(--game-muted); margin-top: -8px; }
.antique-game .game-guess-label { display: block; font-weight: bold; font-size: 13px; margin-bottom: 8px; }
.game-guess { display: flex; align-items: center; border: 1px solid var(--game-border); border-radius: 4px; height: 44px; margin-bottom: 10px; background: var(--game-surface); }
.game-guess > span { padding: 0 14px; color: var(--game-muted); }
.game-guess input { background: transparent; color: var(--game-text); width: 100%; min-width: 0; max-width: none; border: none; height: 100%; padding: 10px 10px 10px 0; font: 16px Arial, sans-serif; }
.game-actions { display: grid; grid-template-columns: minmax(0,1fr) 105px; gap: 8px; }
.antique-game .game-buy { background: var(--game-primary); color: var(--game-primary-text); min-height: 44px; border: 1px solid var(--game-primary); }
.antique-game .game-buy:not(:disabled):hover { background: var(--game-primary-hover); }
.antique-game .game-skip { border-color: var(--game-border); }
.antique-game .game-skip:not(:disabled):hover { background: var(--game-subtle); }
.antique-game .game-small { font-size: 13px; color: var(--game-muted); margin-top: 8px; }
.game-experts { display: flex; align-items: flex-start; gap: 22px; border-top: 1px solid var(--game-border); padding: 18px 28px; background: var(--game-subtle); }
.game-expert-heading { display: flex; align-items: center; gap: 10px; flex-shrink: 0; padding-top: 5px; }
.game-expert-heading strong { display: block; font-size: 13px; }
.game-expert-heading span { display: block; font-size: 13px; color: var(--game-muted); }
.game-hints { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; flex: 1; min-width: 0; }
.game-hint button { width: 100%; flex-wrap: wrap; border: 1px solid var(--game-border); background: var(--game-surface); font-size: 13px; min-height: 43px; padding: 8px 9px; gap: 6px; }
.game-hint button > span { margin-left: auto; color: var(--game-muted); white-space: nowrap; }
.game-hint p { margin-top: 8px; color: var(--game-muted); font-size: 13px; }
.game-reveal { padding: 14px 0; }
.game-reveal h3 { margin: 8px 0 18px; }
.game-reveal-value { border-block: 1px solid var(--game-border); padding: 14px 0; }
.game-reveal-value span { display: block; font-size: 13px; color: var(--game-muted); }
.game-reveal-value strong { font: bold 30px/1.4 Arial, sans-serif; }
.game-result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 18px 0; }
.game-result-grid span { display: block; font-size: 13px; color: var(--game-muted); }
.game-result-grid strong { font-size: 17px; }
.game-positive { color: var(--game-profit); }
.game-negative { color: var(--game-loss); }
.game-next { width: 100%; margin-top: 12px; }
.antique-game .game-end { display: flex; margin: 2px auto 0; font-size: 13px; text-decoration: underline; }
.game-history { border-top: 1px solid var(--game-border); background: var(--game-subtle); display: flex; gap: 25px; padding: 22px 28px; }
.game-history-copy { flex: 1; min-width: 0; }
.game-history h4 { font-size: 18px; margin: 8px 0; }
.game-history p { font-size: 16px; color: var(--game-muted); max-width: 680px; margin-bottom: 10px; }
.game-history iframe { width: 260px; height: 180px; border: 1px solid var(--game-border); }
.game-history-meta { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0 7px; font-size: 13px; }
.game-history a { font-size: 13px; }
.game-footer { padding: 10px 28px; display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid var(--game-border); font-size: 13px; color: var(--game-muted); }
.game-footer .game-live-dot { margin-right: 5px; }
.game-footer-separator { margin: 0 8px; color: var(--game-border); }
.antique-game .game-info { padding: 4px 0; min-height: 26px; font-size: 13px; flex-shrink: 0; color: var(--game-muted); }
.game-disclosure { padding: 14px 28px; background: var(--game-subtle); border-top: 1px solid var(--game-border); }
.game-disclosure p { font-size: 14px; color: var(--game-muted); margin-bottom: 8px; }
.game-error { margin: 8px 28px !important; color: var(--game-loss); font-size: 12px !important; }
.game-secondary { padding: 28px; min-height: 450px; }
.game-view-title { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 20px; margin-bottom: 24px; }
.game-view-title h3 { margin-top: 8px; }
.game-view-title > strong { font: bold 30px Arial, sans-serif; text-align: right; }
.game-view-title small { display: block; font: 10px Arial, sans-serif; color: var(--game-muted); margin-top: 5px; }
.game-empty { min-height: 320px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; color: var(--game-muted); text-align: center; }
.game-empty h4 { font-size: 24px; }
.game-discoveries { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; }
.game-discoveries article { border: 1px solid var(--game-border); border-radius: 4px; overflow: hidden; }
.game-discoveries img { width: 100%; height: 180px; object-fit: contain; background: var(--game-image); }
.game-discoveries article > div { padding: 14px; }
.game-discoveries span, .game-discoveries p, .game-discoveries a { font-size: 13px; color: var(--game-muted); }
.game-discoveries h4 { font-size: 20px; margin: 6px 0; }
.game-discoveries p { margin-bottom: 6px; }
.game-record-table { overflow-x: auto; }
.game-record-table table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
.game-record-table th, .game-record-table td { padding: 15px 12px; border-bottom: 1px solid var(--game-border); white-space: nowrap; }
.game-record-table th { font-size: 13px; color: var(--game-muted); background: var(--game-subtle); }
@media (max-width: 1050px) {
  .homepage #ylaosa { grid-template-columns: auto 1fr; gap: 8px 14px; }
  .homepage #ylaosa form { grid-column: 2; justify-self: end; }
  .homepage #ylaosa h1 { grid-row: 1 / 3; }
  .homepage #ylaosa ul { justify-content: flex-end; }
  .homepage #ylaosa p { display: none; }
  .game-deal-layout { gap: 22px; }
  .game-experts { flex-direction: column; gap: 10px; }
  .game-hints { width: 100%; }
  .game-expert-heading > div { display: flex; align-items: center; gap: 10px; }
  .game-expert-heading { padding: 0; }
}
@media (max-width: 740px) {
  #rakenne.homepage { width: calc(100% - 24px); }
  .homepage #ylaosa { min-height: 66px; }
  .homepage #ylaosa h1 img { width: 185px; }
  .homepage #ylaosa ul { gap: 12px; font-size: 13px; }
  .homepage #ylaosa ul a { padding: 4px 0; font-size: 13px; }
  .homepage #ylaosa form { gap: 3px; }
  .homepage #ylaosa input { width: 100px; font-size: 13px; padding: 6px; }
  .homepage #ylaosa button { font-size: 13px; padding: 6px 4px; }
  .game-heading { padding: 18px; gap: 10px; }
  .antique-game h2 { font-size: 24px; }
  .game-eyebrow { font-size: 13px; }
  .game-mode button { min-width: 65px; padding: 7px 8px; font-size: 13px; }
  .game-toolbar { padding: 0 18px; gap: 8px; }
  .game-tabs { gap: 14px; }
  .game-tabs button { font-size: 13px; gap: 5px; }
  .game-wallet { padding-left: 12px; gap: 8px; }
  .game-wallet strong { font-size: 20px; }
  .game-roundline { padding: 12px 18px; }
  .game-deal-layout { padding: 0 18px 18px; gap: 18px; }
  .game-object-image { height: 320px; padding: 10px; }
  .game-object-bottom { flex-direction: column; align-items: flex-start; padding: 10px; }
  .game-object-top { padding: 10px; font-size: 13px; }
  .game-object-top > span:last-child { display: none; }
  .antique-game h3 { font-size: 20px; }
  .game-trade blockquote { font-size: 16px; margin: 10px 0 12px; }
  .game-asking { padding: 10px 0; }
  .game-actions { grid-template-columns: minmax(0,1fr) 75px; }
  .antique-game button { font-size: 13px; }
  .game-experts { padding: 14px 18px; }
  .game-hints { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .game-hint button { font-size: 13px; }
  .game-history { padding: 18px; flex-direction: column; }
  .game-history iframe { width: 100%; }
  .game-footer { padding: 10px 18px; flex-wrap: wrap; }
  .game-secondary { padding: 20px 18px; }
  .game-view-title { align-items: flex-start; }
  .game-view-title h3 { font-size: 20px; }
  .game-discoveries { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .homepage #keskiosa { padding: 24px 18px; }
  .homepage #sisalto { width: calc(100% - 210px); }
  .homepage #sivupalkki { width: 180px; }
}
@media (max-width: 540px) {
  .homepage #ylaosa { gap: 8px 10px; }
  .homepage #ylaosa h1 img { width: 146px; }
  .homepage #ylaosa ul { gap: 9px; }
  .homepage #ylaosa input { width: 74px; }
  .game-heading { align-items: start; padding: 20px; }
  .antique-game h2 { font-size: 23px; }
  .game-mode { flex-direction: column; }
  .game-mode button { min-height: 38px; padding: 5px 8px; }
  .game-toolbar { flex-wrap: wrap-reverse; padding: 0 14px; gap: 0; }
  .game-wallet { width: 100%; border: none; padding: 10px 0; }
  .game-wallet span { display: flex; align-items: center; justify-content: space-between; width: 100%; font-size: 13px; }
  .game-tabs { width: 100%; justify-content: space-between; gap: 10px; border-top: 1px solid var(--game-border); }
  .game-tabs button { min-height: 48px; font-size: 13px; }
  .game-tabs button svg { width: 13px; }
  .game-roundline { padding: 10px 14px; font-size: 13px; }
  .game-roundline > span:last-child { display: none; }
  .game-deal-layout { grid-template-columns: 1fr; padding: 0 14px 18px; gap: 18px; }
  .game-object-image { height: 200px; padding: 8px 20px; }
  .game-object-top { padding: 9px 12px; }
  .game-object-top > span:last-child { display: block; }
  .game-object-bottom { flex-direction: column; align-items: flex-start; padding: 9px 12px; font-size: 13px; }
  .game-trade blockquote { font-size: 16px; margin: 10px 0 14px; }
  .game-experts { padding: 14px; }
  .game-footer { padding: 10px 14px; font-size: 13px; }
  .game-footer-separator { margin: 0 4px; }
  .game-disclosure { padding: 14px; }
  .game-view-title { grid-template-columns: minmax(0,1fr); }
  .game-view-title > strong { font-size: 27px; text-align: left; }
  .game-discoveries { grid-template-columns: 1fr; }
  .homepage #sisalto, .homepage #sivupalkki { float: none; display: block; width: 100%; }
  .homepage #sivupalkki { margin-top: 24px; }
}
@media (prefers-reduced-motion: reduce) { .antique-game button { transition: none; } }