/* まなべる花札 こいこい — original landscape game stage
 * Distinct zones, tactile lacquer/wood/paper materials, and a learning sidebar.
 * No competitor artwork or interface assets are included.
 */
.landscape-title,.coach-mast,.opponent-backs,.opponent-card-back,.field-stock{display:none}
.brand-home{display:flex;align-items:center;gap:5px;padding:0;border:0;background:transparent;cursor:pointer;text-align:left}
.brand-home .brand-name{font-weight:800}
@media (orientation:landscape) and (max-height:620px) {
  :root{--game-gold:#dcc18b;--game-ink:#f6ebd1;--game-scarlet:#a44732}
  html,body,#app{height:100%;width:100%;overflow:hidden}
  .shell{height:100dvh;min-height:0;background:
    radial-gradient(circle at 15% 16%,#a877412c,transparent 36%),
    radial-gradient(circle at 87% 86%,#536b4440,transparent 40%),
    repeating-linear-gradient(0deg,#f3d3a604 0px 1px,transparent 1px 6px),
    #161f1d}
  .shell::before{content:"";position:absolute;inset:8px;pointer-events:none;border:1px solid #bea3731c}
  .page{position:relative;max-width:1500px;height:100%;min-height:0;
    padding:5px calc(max(env(safe-area-inset-right), 8px) + 5px)
      5px calc(max(env(safe-area-inset-left), 8px) + 5px);
    display:grid;grid-template-rows:36px minmax(0,1fr);overflow:hidden}
  .topbar{z-index:2;min-height:0;height:36px;margin:0;padding:0 3px 4px;
    border:0;border-bottom:1px solid #c5a46c62;display:flex;align-items:center}
  .topbar .brand,.brand-home{color:#f0dfb9;font-size:13px;letter-spacing:.045em}
  .topbar .brand-name{display:flex;flex-direction:row;align-items:baseline;gap:7px}
  .topbar .brand-name small{color:#bea479;font-size:12px;letter-spacing:.06em}
  .topbar .seal,.brand-home .seal{width:25px;height:25px;min-height:25px;font-size:15px;
    margin:0 2px 0 0;border-color:#b98f58;border-radius:3px}
  .topbar .quiet{min-height:27px;padding:3px 11px;border-radius:4px;
    color:#f4e6c4;background:linear-gradient(#624832,#382b25);
    border-color:#a98a5d;font-size:11px;box-shadow:0 1px 0 #181a14}
  .scene-body{height:100%;min-height:0;overflow:hidden}
  .scene-nav{display:none!important}
  .footerlinks{display:none}
  .primary,.secondary{min-height:35px;border-radius:5px;padding:7px 11px;font-size:12px}
  .primary{background:linear-gradient(180deg,#b85c3b,#7c3026);
    border:1px solid #d8aa69;box-shadow:inset 0 1px #f0b27b,0 2px 0 #53261d;color:#fff3d9}
  .secondary{background:linear-gradient(180deg,#faebc8,#d5be8e);
    border:1px solid #b99864;box-shadow:0 2px 0 #8c6f46;color:#363b2b}
  .quiet:focus-visible,.primary:focus-visible,.secondary:focus-visible,
  button:focus-visible{outline:3px solid #e9c76c;outline-offset:2px}
  /* Full-bleed title composition rather than a dashboard */
  .scene-home .page{grid-template-rows:minmax(0,1fr)}
  .scene-home .topbar{position:absolute;z-index:10;right:calc(max(env(safe-area-inset-right),8px) + 8px);
    top:9px;display:flex;justify-content:flex-end;width:auto;border:0;pointer-events:none}
  .scene-home .topbar .brand{display:none}
  .scene-home .topbar .row{pointer-events:auto}
  .scene-home .scene-body{height:100%}
  .hub{height:100%;min-height:0;display:grid;position:relative;
    grid-template-columns:minmax(0,1.05fr) minmax(270px,.95fr);
    grid-template-rows:repeat(4,minmax(0,1fr)) 18px;gap:6px 14px;padding:10px 7px 4px}
  .hub-hero{grid-column:1;grid-row:1/5;position:relative;min-height:0;padding:0;
    background:radial-gradient(ellipse at 30% 30%,#52604b66,transparent 48%),
    linear-gradient(140deg,#203b30,#162b27 72%,#0d2522);border:2px solid #ad8a55;
    border-radius:4px 35px 5px 5px;box-shadow:inset 0 0 0 7px #a8a16d13,0 8px 18px #0a100c70}
  .hub-hero::before{content:"";position:absolute;width:min(29vw,230px);aspect-ratio:1;
    border:1px solid #d0b27934;border-radius:50%;right:7%;top:7%;
    background:radial-gradient(circle,#dbc28a1c 0 45%,transparent 45%);
    box-shadow:0 0 0 16px #d2bb7b0d;pointer-events:none}
  .hub-hero::after{content:"";position:absolute;inset:auto 20px 14px 20px;border-top:1px solid #dbbc7655;
    font-size:0;letter-spacing:0;padding:0}
  .hub-hero .eyebrow{position:absolute;left:21px;top:17px;color:#d3b477;letter-spacing:.19em;font-size:9px}
  .hub-hero>h1,.hub-hero>p{display:none}
  .landscape-title{display:flex;position:absolute;z-index:3;left:5%;top:31%;
    flex-direction:column;gap:0;max-width:66%;color:#fbedd0;text-shadow:0 3px 5px #061810}
  .landscape-title>span{font-size:clamp(9px,1.2vw,13px);letter-spacing:.2em;color:#e3c58f;margin-bottom:7px}
  .landscape-title strong{font:600 clamp(24px,3.5vw,52px) "Yu Mincho","Hiragino Mincho ProN",serif;
    letter-spacing:.12em;white-space:nowrap;line-height:1.25}
  .landscape-title b{font:600 clamp(31px,4vw,57px) "Yu Mincho","Hiragino Mincho ProN",serif;
    letter-spacing:.27em;color:#f4d69b;line-height:1.3}
  .landscape-title b::after{content:"";display:block;width:66%;height:5px;margin-top:7px;
    background:linear-gradient(90deg,#a33e31,#cb8a4d,transparent);transform:skewX(-29deg)}
  .hub-hero .hero-cards{position:absolute;right:16%;top:13%;transform:rotate(13deg);width:90px;height:155px}
  .hub-hero .hero-cards img{width:clamp(56px,8vw,92px);border:1px solid #cbb487;border-radius:2px;
    box-shadow:0 9px 11px #051b13ad}
  .hub-hero .hero-cards img:nth-child(2){left:14px;top:25px}
  .hub-hero .hero-cards img:nth-child(3){left:35px;top:48px}
  .hub-tutorial{grid-column:2;grid-row:1/3;position:relative;display:flex;flex-direction:column;
    justify-content:center;gap:5px;padding:10px 16px;
    border:1px solid #d0ac6c;border-left:5px solid #a54b36;border-radius:4px;
    background:linear-gradient(115deg,#f7e9c4,#dcbe8a);
    box-shadow:inset 0 0 0 5px #fff7db4a,0 5px 12px #070e0b5e}
  .hub-tutorial::before{content:"初";position:absolute;right:18px;top:4px;font-size:82px;
    font-family:"Yu Mincho",serif;color:#aa743344;pointer-events:none}
  .hub-tutorial .hub-badge{font-size:clamp(10px,1.15vw,12px);color:#93452e}
  .hub-tutorial strong{font-size:clamp(19px,2.8vw,29px);color:#243d31}
  .hub-tutorial>span:not(.hub-badge){font-size:clamp(10px,1.15vw,12px)}
  .hub-tutorial b{position:relative;right:auto;bottom:auto;align-self:flex-start;font-size:11px;margin-top:2px}
  .hub-modes{grid-column:2;grid-row:3;grid-template-columns:1fr 1fr;gap:7px;min-height:0}
  .hub-mode{min-height:0;padding:7px 10px;border-radius:4px;gap:4px;box-shadow:inset 0 0 0 3px #efd39b25}
  .hub-mode strong{font-size:clamp(15px,2vw,22px)}
  .hub-mode span,.hub-mode small{font-size:10px}
  .hub-journey{background:linear-gradient(125deg,#375744,#1f4036);border:1px solid #c4ad6b}
  .hub-free{background:linear-gradient(125deg,#6b4938,#442c29);color:#f5e5c6;border:1px solid #bc9366}
  .hub-free span,.hub-free small{color:#ddc3a2}
  .hub-learn{grid-column:2;grid-row:4;min-height:0;padding:5px 35px 5px 14px;
    background:linear-gradient(120deg,#f9f0d8,#d8c49b);border:1px solid #c6a574;
    border-radius:4px;box-shadow:0 4px 9px #070c0852;gap:1px}
  .hub-learn strong{font-size:clamp(15px,2vw,20px)}
  .hub-learn span{font-size:11px}
  .hub-progress{grid-column:1/-1;grid-row:5;color:#cab78d;font-size:10px;min-height:0;padding:0 5px}
  .hub-resume{position:absolute;z-index:6;left:20px;bottom:30px;width:auto;flex:none;
    padding:5px 12px;min-height:29px;border-radius:3px;background:#dbc28d;color:#2c3d2c}
  /* Landscape match — keep 3 card regions visually distinct */
  .scene-game .page{grid-template-rows:34px minmax(0,1fr)}
  .scene-game .topbar{height:34px}
  .play-layout{height:100%;min-height:0;display:grid;
    grid-template-columns:minmax(0,1fr) clamp(185px,24vw,260px);
    grid-template-rows:31px minmax(0,1fr);gap:6px;padding:4px 1px 3px}
  .play-layout .gameheader{grid-column:1/-1;grid-row:1;min-height:0;padding:2px 11px;
    border-radius:3px;background:linear-gradient(90deg,#362922,#213e32 60%,#1c342f);
    border:1px solid #b5985e;box-shadow:inset 0 0 0 2px #e2cc8e1c}
  .play-layout .gameheader .game-score{font-size:19px;letter-spacing:.045em}
  .round-badge{flex-direction:row;align-items:baseline;gap:8px;font-size:12px}
  .play-layout .gameheader .coach-detail{min-height:25px;border-radius:3px;
    background:#dccaa4;color:#33432e;border-color:#b29462;font-size:10px}
  .game-board-wrap{grid-column:1;grid-row:2;min-width:0;min-height:0}
  .play-layout .tabletop{height:100%;display:grid;grid-template-columns:1fr;
    grid-template-rows:36px minmax(0,1fr) 24px minmax(0,.80fr);gap:3px;
    padding:7px 9px;border:5px solid #7c5335;border-radius:8px;
    outline:1px solid #caa36a;box-shadow:inset 0 0 0 2px #b99f70,
      inset 0 0 20px #0d261de0,0 8px 18px #020b08a0;
    background:radial-gradient(ellipse at 45% 20%,#476a4f 0,#24513f 45%,#173b31 100%);overflow:hidden}
  .board-opponent{display:flex;align-items:center;gap:10px;min-width:0;min-height:0;
    border-bottom:1px solid #dfce974f;padding:0 3px;background:transparent}
  .opponent-label{min-width:98px;display:flex;flex-direction:column;gap:2px;color:#f7e7be}
  .opponent-label strong{font-size:12px;white-space:nowrap}
  .opponent-label span{font-size:9px;color:#d5c99f;white-space:nowrap}
  .opponent-backs{display:flex;align-items:center;justify-content:center;gap:4px;min-width:0;flex:1}
  .opponent-card-back{display:grid;place-items:center;width:19px;height:29px;flex:0 1 19px;
    border:1px solid #e4c591;border-radius:2px;background:
      repeating-linear-gradient(-45deg,#8e2824 0 3px,#bc4834 3px 6px);
    box-shadow:inset 0 0 0 2px #782321,0 1px 3px #122a1d}
  .opponent-card-back i{display:grid;place-items:center;width:10px;height:14px;border:1px solid #ddb987;
    color:#f1dba2;font:normal 10px Georgia,serif}
  .capture-link{flex:none;border:1px solid #9aa88b;border-radius:3px;
    background:#203f33;color:#f5e5c6;padding:4px 6px;min-height:25px;font-size:10px;white-space:nowrap}
  .board-zone{display:flex;flex-direction:column;min-height:0;min-width:0;gap:3px}
  .board-field{min-height:0;border:2px solid #bfaf8b;border-radius:5px;padding:4px 7px;
    background:linear-gradient(135deg,#eaddbd,#f4ebd8 55%,#d7c8a7);
    box-shadow:inset 0 0 0 2px #fff7de,0 2px 4px #061c13a1}
  .board-zone-caption{display:flex;align-items:center;justify-content:space-between;min-height:18px;
    font-size:10px;color:#385746;padding:0 3px;gap:5px}
  .board-zone-caption strong{font-size:13px;color:#315342;white-space:nowrap}
  .board-zone-caption small{font-size:10px;color:#775c34}
  .board-zone-caption span{font-size:10px;color:#686045;white-space:nowrap}
  .landscape-fieldline{flex:1;min-height:0;min-width:0;display:grid;grid-template-columns:minmax(0,1fr) 49px;gap:6px}
  .play-layout .fieldcards{display:flex;justify-content:center;align-items:stretch;
    flex-wrap:nowrap;min-height:0;height:100%;width:100%;padding:0;gap:3px;overflow:hidden}
  .play-layout .fieldcards .card-slot{flex:1;min-width:0;max-width:58px}
  /* Keep every field card in one visible row when the field grows beyond 8.
     Two rows leave less than 24px for artwork on landscape iPhones. */
  .play-layout .fieldcards.dense{display:flex;flex-wrap:nowrap;gap:2px}
  .play-layout .fieldcards.dense .card-slot{flex:1 1 0;min-width:0;max-width:58px}
  .play-layout .fieldcards.dense .hana img{object-fit:contain;background:#f0e6d0}
  .field-stock{min-height:0;display:flex;flex-direction:column;align-items:center;
    justify-content:center;gap:4px;color:#545439;border-left:1px solid #927e573b}
  .stock-back{display:grid;place-items:center;width:27px;height:43px;border:2px solid #d6b982;
    border-radius:2px;background:linear-gradient(145deg,#b24632,#7d2929);
    box-shadow:2px 2px 0 #55352c,3px 3px 0 #c6ad83;color:#eed4a3}
  .field-stock small{font-size:10px;white-space:nowrap;font-weight:700}
  .board-taken{display:flex;align-items:center;justify-content:flex-start;gap:8px;min-width:0;
    padding:0 4px;border-top:0;border-bottom:1px solid #ddc99364;background:transparent}
  .board-taken strong{font-size:11px;color:#f7eac8}
  .board-taken span{font-size:11px;color:#dccd9e}
  .board-taken button{margin-left:auto}
  .board-hand{min-height:0;border:1px solid #ac935b;border-radius:3px;
    background:linear-gradient(150deg,#1c4032,#17352c);padding:3px 7px}
  .board-hand .board-zone-caption strong{color:#ffe8aa}
  .board-hand .board-zone-caption small{color:#e2c482}
  .board-hand .board-zone-caption span{color:#d9d9bd}
  .play-layout .handcards{display:flex;justify-content:center;align-items:stretch;
    min-height:0;height:100%;padding:0;gap:4px;overflow:hidden}
  .play-layout .handcards .card-slot{flex:1;min-width:0;max-width:58px}
  .play-layout .card-slot{height:100%;min-height:0;width:100%;display:flex;
    flex-direction:column;align-items:center;justify-content:stretch;gap:2px}
  .play-layout .card-slot .hana{flex:1 1 auto;min-height:0;height:1px;width:auto;max-width:100%;
    aspect-ratio:512/839;object-fit:contain;box-shadow:0 2px 3px #061e16b8;
    border-radius:2px;background:#f0e6d0}
  .play-layout .card-slot .hana img{height:100%;width:100%;object-fit:fill;border-radius:1px}
  .play-layout .card-slot .card-name{flex:0 0 16px;min-height:16px;height:16px;max-height:16px;width:100%;
    padding:1px 0;background:#fff1ce;border-radius:2px;border:1px solid #cdb889;
    text-align:center;overflow:hidden}
  .play-layout .card-name strong{font-size:clamp(8px,1.18vw,10px);line-height:13px}
  .play-layout .card-name span{display:none!important}
  .play-layout .hana.selected{transform:translateY(-2px);outline:3px solid #f9d35d;outline-offset:1px}
  .play-layout .hana.target{transform:none;outline:3px solid #ea9733;outline-offset:1px;animation:pulse 1.2s infinite}
  .play-layout .hana.hint{box-shadow:0 0 0 2px #e0cc71}
  .play-layout .hana.playable{outline:1px solid #c3b47c;outline-offset:0}
  /* Guide: large enough to read, not a second spreadsheet-style control panel */
  .play-layout .controlpad{grid-column:2;grid-row:2;position:relative;min-width:0;min-height:0;
    display:flex;flex-direction:column;justify-content:space-between;gap:8px;
    padding:13px 13px 11px;margin:0;
    border:2px solid #c5a46c;border-left:4px solid #a94a36;border-radius:4px;
    background:linear-gradient(120deg,#faf0d1,#e3d2a8 60%,#d2b88e);
    box-shadow:inset 0 0 0 4px #fff7dc77,0 5px 12px #05130e80;
    overflow:hidden}
  .play-layout .controlpad::before,.play-layout .controlpad::after{display:none}
  .coach-mast{display:flex;flex:0 0 auto;align-items:center;gap:6px;
    border-bottom:1px solid #9d7f526e;padding-bottom:7px;min-height:38px}
  .coach-monogram{display:grid;place-items:center;width:28px;height:28px;flex:none;
    background:#ab4b38;border:1px solid #e5c798;border-radius:3px;
    color:#fff4d3;font:700 18px "Yu Mincho",serif}
  .coach-mast strong{font:800 clamp(13px,1.7vw,19px) "Yu Mincho",serif;
    color:#334c3a;white-space:nowrap}
  .coach-mast small{display:none}
  .coach-prompt{flex:1;display:flex;flex-direction:column;gap:7px;justify-content:center;min-height:0}
  .play-layout .tutor-kicker{font-size:10px;color:#9a5537;font-weight:800;letter-spacing:.05em}
  .play-layout .coach-prompt strong{font:800 clamp(14px,1.72vw,20px) "Yu Mincho",serif;
    line-height:1.35;color:#354838;white-space:normal}
  .play-layout .coach-prompt p{font-size:clamp(11px,1.22vw,14px);line-height:1.55;
    margin:0;color:#5c5644;display:-webkit-box;-webkit-line-clamp:5;-webkit-box-orient:vertical;overflow:hidden}
  .coach-actions{display:flex;flex:0 0 auto;flex-direction:column;gap:5px;width:100%;min-height:0}
  .coach-actions button{min-width:0!important;min-height:39px;width:100%;max-width:none;
    padding:7px 6px!important;font-size:12px}
  .coach-footer{font-size:9px;color:#826b48;border-top:1px solid #af95694d;
    padding-top:6px;white-space:nowrap;text-align:center}
  .coach-footer span{color:#a34736;font-size:13px}
  .play-layout .result{inset:4px;border-radius:6px}
  .game-dialog{align-items:center}
  .dialog-sheet{max-width:min(600px,90%);max-height:88%;border-radius:7px;overflow:auto}
  .dialog-cards{grid-template-columns:repeat(8,minmax(0,1fr));gap:5px}
  /* Guided region identification. Opponent backs are never mistaken for the shared field. */
  .tutorial-intro .tabletop .region-opponent,
  .tutorial-intro .tabletop .region-field,
  .tutorial-intro .tabletop .region-hand{transition:box-shadow .15s,filter .15s}
  .intro-step-0 .region-opponent{background:#b9a06a24;box-shadow:0 0 0 2px #edc45a,inset 0 0 0 2px #edc45a;border-radius:4px}
  .intro-step-1 .region-field{box-shadow:0 0 0 3px #c37b36,0 0 13px #f4c465}
  .intro-step-2 .region-hand{box-shadow:0 0 0 3px #eac05c,0 0 15px #eac05c}
  .intro-step-0 .region-field,.intro-step-0 .region-hand,
  .intro-step-1 .region-opponent,.intro-step-1 .region-hand,
  .intro-step-2 .region-opponent,.intro-step-2 .region-field{filter:brightness(.72)}
  /* Secondary pages keep the same stage but use dedicated scene navigation. */
  .scene-learn .study-hub{height:100%;display:grid;grid-template-columns:35% minmax(0,1fr);
    grid-template-rows:repeat(3,minmax(0,1fr));gap:6px 13px;padding:9px 7px}
  .study-heading{grid-column:1;grid-row:1;display:flex;flex-direction:column;justify-content:center;
    padding:7px;color:#f1e3c8}
  .study-heading h1{font:700 clamp(21px,3vw,34px) "Yu Mincho",serif;color:#f2e4c6;margin:3px 0}
  .study-heading p,.study-foot{font-size:11px;color:#cdbd9d;line-height:1.4}
  .study-main{grid-column:1;grid-row:2;min-height:0;padding:9px 14px;border-radius:4px}
  .study-main strong{font-size:21px}
  .study-actions{grid-column:2;grid-row:1/4;grid-template-rows:repeat(2,minmax(0,1fr));gap:8px}
  .study-actions button{padding:12px;border-radius:4px;
    background:linear-gradient(120deg,#e4d0a4,#c7af82);border:1px solid #dcb97a}
  .study-actions button strong{font-size:clamp(15px,1.8vw,20px);color:#263c2f}
  .study-actions button span{font-size:11px;color:#604d3a}
  .study-foot{grid-column:1;grid-row:3;align-self:center;text-align:left;padding:7px}
  .scene-travel .scene-body,.scene-chapter .scene-body,.scene-free .scene-body,
  .scene-cards .scene-body,.scene-yaku .scene-body,.scene-columns .scene-body,
  .scene-quiz .scene-body,.scene-settings .scene-body{color:#f6e9d0}
  .scene-travel .panel,.scene-chapter .panel,.scene-free .panel,
  .reference-note,.setting-row{border-radius:4px}
  .scene-travel .month-grid{grid-template-columns:repeat(6,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr))}
  .scene-travel .panel{background:linear-gradient(#e8d6b0,#d8c49f);color:#2b4937}
  .scene-chapter .panel,.scene-free .panel{background:linear-gradient(120deg,#f8edd1,#e7d2a6);color:#2c3c2e}
  .scene-chapter .story{line-height:1.5}
  .reference-page{grid-template-rows:44px 35px minmax(0,1fr) minmax(40px,.32fr) 16px;
    padding:4px 6px;gap:4px}
  .reference-page .chapter-title{color:#f4e4c6;font-size:20px}
  .reference-page .kicker{color:#d8ae75;font-size:10px}
  .reference-top{background:#dbcca9;color:#35503b;border-radius:3px}
  .reference-note{background:#f1e6cc;padding:6px 9px;color:#38533e}
  .reference-note strong{font-size:14px}
  .reference-note p{-webkit-line-clamp:3;font-size:11px}
  .reference-cards .card-slot .hana{max-height:100%;height:auto}
  .reference-cards .catalogitem{max-width:105px}
  .reference-yaku img{height:min(100%,38dvh)}
  .scene-free .panel .stack{max-height:unset}
  .scene-quiz .quiz-screen{grid-template-columns:45% 55%;grid-template-rows:42px minmax(0,1fr) 33px;gap:5px 12px;padding:5px}
  .scene-quiz .quiz-head{grid-column:1;grid-row:1}
  .scene-quiz .quiz-title{color:#f4e2be;font-size:19px}
  .scene-quiz .quiz-art{grid-column:1;grid-row:2}
  .scene-quiz .quiz-options{grid-column:2;grid-row:1/3}
  .scene-quiz .quiz-feedback{grid-column:1/-1;grid-row:3}
  .scene-quiz .quiz-counter{display:none}
  .scene-settings .settings-screen{grid-template-columns:repeat(3,minmax(0,1fr));
    grid-template-rows:50px minmax(0,1fr) 42px 28px;gap:6px;padding:6px}
  .scene-settings .settings-head{grid-column:1/-1}
  .scene-settings .settings-head h1{color:#eedbb3;font-size:23px}
  .scene-settings .setting-row{grid-row:2;background:#f4e6c7;justify-content:center}
  .scene-settings .settings-retry{grid-column:1/-1;grid-row:3}
  .scene-settings .settings-credits{grid-column:1/-1;grid-row:4}
}
@media (orientation:landscape) and (max-height:390px) {
  .play-layout{grid-template-columns:minmax(0,1fr) 192px;gap:4px}
  .play-layout .tabletop{padding:4px 6px;grid-template-rows:30px minmax(0,1fr) 20px minmax(0,.80fr);gap:2px}
  .opponent-card-back{width:16px;height:24px}
  .opponent-label{min-width:88px}
  .opponent-label strong{font-size:10px}
  .opponent-label span{font-size:8px}
  .board-field{padding:2px 5px}
  .board-zone-caption strong{font-size:11px}
  .board-zone-caption span{font-size:9px}
  .play-layout .card-slot .card-name{height:14px;min-height:14px;max-height:14px;flex-basis:14px}
  .play-layout .card-name strong{font-size:8px;line-height:12px}
  .play-layout .controlpad{padding:8px 9px;gap:4px}
  .coach-mast{padding-bottom:4px;min-height:28px}
  .coach-mast strong{font-size:14px}
  .coach-monogram{width:22px;height:22px;font-size:15px}
  .coach-prompt{gap:4px}
  .play-layout .coach-prompt strong{font-size:14px}
  .play-layout .coach-prompt p{font-size:10px;-webkit-line-clamp:4}
  .coach-actions button{min-height:33px}
  .coach-footer{display:none}
  .hub{padding:4px 6px}
  .hub-hero .eyebrow{top:12px}
  .hub-hero .hero-cards{right:13%;top:11%}
  .landscape-title{top:29%}
  .hub-tutorial{padding:6px 11px}
  .hub-tutorial strong{font-size:19px}
  .hub-mode{padding:5px}
  .hub-mode strong{font-size:14px}
  .hub-learn strong{font-size:14px}
}

/* Give the cards the space previously reserved for an absent native banner.
   Preserve the banner reservation only when the native SDK reports it visible. */
@media (orientation:landscape) and (max-height:620px){
  html.app-viewport .page{
    padding-top:5px;
    padding-bottom:max(5px,env(safe-area-inset-bottom));
    padding-left:max(9px,env(safe-area-inset-left));
    padding-right:max(9px,env(safe-area-inset-right));
  }
  html.app-viewport.native-ad-visible .page{
    padding-bottom:calc(var(--app-banner-height) + env(safe-area-inset-bottom) + 2px);
  }
  .play-layout .tabletop{
    grid-template-rows:32px minmax(0,1fr) 22px minmax(0,.96fr);
  }
  .play-layout .card-slot .card-name{
    flex:0 0 21px;height:21px;max-height:21px;min-height:21px;
    padding:1px 0;display:flex;flex-direction:column;
  }
  .play-layout .card-name strong{font-size:clamp(8px,1.05vw,10px);line-height:10px}
  .play-layout .card-name span{
    display:block!important;font-size:clamp(7px,.91vw,9px);line-height:9px;
    overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  }
  .study-actions button{position:relative;padding:11px 63px 11px 11px;overflow:hidden;
    border:2px solid #ba975e;box-shadow:inset 0 0 0 3px #fff2d661,0 4px 9px #090e0955;
    background:linear-gradient(135deg,#f5e7c5,#d8bb86);}
  .study-actions button:nth-child(2){background:linear-gradient(135deg,#e2d4b3,#c5a976)}
  .study-actions button:nth-child(3){background:linear-gradient(135deg,#e5d6b3,#b8ad88)}
  .study-actions button:nth-child(4){background:linear-gradient(135deg,#eddfbe,#c8b695)}
  .study-actions button img{
    position:absolute;right:11px;top:50%;height:76%;max-height:93px;width:auto;
    transform:translateY(-50%) rotate(8deg);border:1px solid #5a3825;
    box-shadow:2px 4px 4px #36291c75;pointer-events:none;
  }
  .study-actions button:nth-child(even) img{transform:translateY(-50%) rotate(-8deg)}
  .study-actions button strong,.study-actions button span{position:relative;z-index:1}
  .study-actions button strong{font-size:clamp(14px,1.7vw,21px)}
}
@media (orientation:landscape) and (max-height:390px){
  .play-layout .tabletop{grid-template-rows:28px minmax(0,.98fr) 20px minmax(0,.96fr)}
  .play-layout .card-slot .card-name{flex-basis:19px;height:19px;max-height:19px;min-height:19px}
  .play-layout .card-name strong{line-height:9px;font-size:8px}
  .play-layout .card-name span{line-height:8px;font-size:7px}
}
/* Portrait is a compatibility fallback until native landscape enforcement. */
.coach-footer{display:none}
@media (orientation:landscape) and (max-height:620px){
 .coach-footer{display:block}
}
@media (orientation:landscape) and (max-height:390px){
 .coach-footer{display:none}
}

/* Fixed almanac: artwork and labels remain in their own stage, never under the notes. */
@media (orientation:landscape) and (max-height:620px){
 .reference-page .reference-cards{
   display:grid;grid-template-columns:repeat(4,minmax(0,1fr));
   grid-template-rows:minmax(0,1fr);align-items:stretch;justify-items:center;
   gap:8px;min-height:0;overflow:hidden;
 }
 .reference-page .reference-cards .catalogitem{
   min-width:0;min-height:0;width:100%;height:100%;max-width:110px;
   display:flex;justify-content:center;
 }
 .reference-page .reference-cards .card-slot{
   min-height:0;min-width:0;height:100%;width:100%;
   display:grid;grid-template-rows:minmax(0,1fr) 29px;
   gap:2px;justify-items:center;
 }
 .reference-page .reference-cards .card-slot .hana{
   min-width:0;min-height:0;height:100%;width:auto;max-height:100%;max-width:100%;
   aspect-ratio:512/839;margin:0;
 }
 .reference-page .reference-cards .card-name{
   min-width:0;min-height:29px;height:29px;width:100%;margin:0;
   overflow:hidden;white-space:nowrap;padding:2px 0;
 }
 .reference-page .reference-cards .card-name strong{font-size:10px;line-height:12px}
 .reference-page .reference-cards .card-name span{font-size:9px;line-height:11px}
}

/* Twelve seasonal stamps: a miniature travel map, not a settings grid. */
.month-art{display:none}
@media (orientation:landscape) and (max-height:620px){
 .scene-travel .month{position:relative;isolation:isolate;align-items:flex-start;
   justify-content:center;text-align:left;padding:8px 7px;overflow:hidden;
   border:1px solid #bda779;border-radius:3px;
   background:linear-gradient(125deg,#f0e2c0,#d9c59e);
   box-shadow:inset 0 0 0 3px #f8ead450,0 3px 5px #1f241a36}
 .scene-travel .month strong{font-size:clamp(19px,2.6vw,29px);line-height:1;color:#38503d;z-index:1}
 .scene-travel .month>span:not(.mark){width:56%;margin:0;color:#6e614a;
   font-size:clamp(8px,.98vw,10px);line-height:1.35;z-index:1}
 .scene-travel .month .mark{color:#9f5337;z-index:2}
 .scene-travel .month img.month-art{
   position:absolute;display:block;top:12%;right:5px;height:75%;max-width:42%;
   object-fit:contain;border:1px solid #775b42;border-radius:2px;
   transform:rotate(6deg);box-shadow:2px 3px 5px #2d211f64;z-index:0}
 .scene-travel .month.locked{opacity:1;border-color:#938b77;background:linear-gradient(120deg,#bdb9a9,#9f9d8b)}
 .scene-travel .month.locked img{filter:grayscale(1);opacity:.35}
 .scene-travel .month.ready{border:2px solid #e7b357;background:linear-gradient(120deg,#fff4cd,#e0c68d)}
 .scene-travel .month.cleared{background:linear-gradient(120deg,#e0e5ce,#bdceb0)}
}
@media (orientation:landscape) and (max-height:620px){
 .scene-travel .scene-body>.row .chapter-title,
 .scene-chapter .scene-body>.row .chapter-title,
 .scene-free .scene-body>.row .chapter-title,
 .scene-credits .scene-body>.row .chapter-title{
   color:#f4e6c9;text-shadow:0 2px 2px #13201b;
 }
 .scene-travel .scene-body>.row .kicker,
 .scene-chapter .scene-body>.row .kicker,
 .scene-free .scene-body>.row .kicker{
   color:#d3af77;
 }
 .scene-chapter .panel .chapter-title{color:#365140;text-shadow:none}
}

/* Story chapter is a little illustrated interlude, not an empty form. */
@media (orientation:landscape) and (max-height:620px) {
 .scene-chapter .panel{
   position:relative;isolation:isolate;overflow:hidden;
   display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;
   border:2px solid #b9a274;border-radius:4px;padding:14px 18px;
   background:radial-gradient(ellipse at 78% 45%,#dac394a6 0%,transparent 42%),
    linear-gradient(125deg,#f6eacc,#ddc9a1);
   box-shadow:inset 0 0 0 6px #fff6d060,0 6px 11px #010d0658;
 }
 .scene-chapter .panel::after{
   content:"✿";position:absolute;right:5%;bottom:-35%;z-index:-1;
   color:#9d835229;font:260px "Yu Mincho",serif;pointer-events:none;
 }
 .scene-chapter .panel>.kicker{
   font-size:10px;color:#a66540;letter-spacing:.20em;
   border-bottom:1px solid #a98e5b5b;padding-bottom:6px;width:58%;
 }
 .scene-chapter .panel>.row{
   display:flex;align-items:center;max-width:59%;height:auto;flex:none;
   margin-top:9px;
 }
 .scene-chapter .panel .chapter-title{
   font:750 clamp(22px,3vw,30px) "Yu Mincho",serif;line-height:1.2;
   color:#344e3a;
 }
 .scene-chapter .panel .tag{
   color:#84543c;background:#e9d9b7;border:1px solid #c9b084;
   font-size:11px;
 }
 .scene-chapter .panel .row img{
   position:absolute;top:11%;right:15%;height:70%!important;max-height:70%!important;
   width:auto!important;max-width:25%!important;object-fit:contain;
   transform:rotate(7deg);border:2px solid #7a5840;border-radius:2px;
   box-shadow:6px 9px 9px #4f403074;
 }
 .scene-chapter .panel .story{
   position:relative;z-index:1;flex:none;max-width:58%;
   color:#4f5345;font-size:clamp(11px,1.36vw,14px);
   line-height:1.75;margin-top:12px;
   display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden;
 }
 .scene-chapter .panel .primary{
   position:absolute;left:18px;bottom:14px;min-height:37px;
   width:55%;margin:0;max-width:450px;z-index:2;
   align-self:flex-start;
 }
}
@media (orientation:landscape) and (max-height:390px) {
 .scene-chapter .panel{padding:10px 13px}
 .scene-chapter .panel .row img{right:12%;height:69%!important;max-height:69%!important}
 .scene-chapter .panel .story{margin-top:6px;-webkit-line-clamp:3;font-size:11px;line-height:1.6}
 .scene-chapter .panel .primary{left:13px;bottom:9px;min-height:32px}
}

/* Portrait browser guidance: CSS orientation prompt; native iPhone is landscape-only. */
#portrait-hint{display:none}
@media (orientation:portrait) and (max-width:600px){
  #portrait-hint{
    display:flex;position:fixed;inset:0;z-index:9999;pointer-events:none;
    align-items:center;justify-content:center;padding:24px;
    background:radial-gradient(circle at 50% 40%,#294f3f,#142e28 70%,#0b201c);
    color:#f7ebcb;text-align:center;
  }
  .portrait-hint-inner{
    width:100%;max-width:340px;border:1px solid #c3a46e;
    box-shadow:inset 0 0 0 5px #fff3ce13,0 13px 30px #02100b80;
    border-radius:9px;padding:26px 20px;background:#1b4034;
  }
  .portrait-hint-inner .rotate-symbol{display:block;font-size:64px;line-height:1;color:#edc786;transform:rotate(-20deg)}
  .portrait-hint-inner strong{display:block;font:750 23px "Yu Mincho","Hiragino Mincho ProN",serif;line-height:1.45;margin:14px 0;color:#fff0c9}
  .portrait-hint-inner p{font-size:13px;line-height:1.8;color:#e9ddb9;margin:0}
}
