.game-main.play-main{max-width:1280px;padding-top:0}.play-page .header-row{min-height:52px}.play-intro{display:grid;grid-template-columns:auto auto minmax(0,1fr);align-items:center;gap:8px 14px;padding:6px 0 10px}.play-back{padding-inline-end:14px;border-inline-end:1px solid #ffffff20;font-size:12px;color:var(--muted)}.play-back a{display:inline-flex;align-items:center;gap:6px;min-height:36px}.play-back a:hover{color:var(--accent)}.play-intro h1{min-width:0;margin:0;font-size:22px;line-height:1.3;letter-spacing:-.025em;overflow-wrap:anywhere}.play-intro p{min-width:0;max-width:76ch;margin:0;color:var(--muted);font-size:13px;line-height:1.6}.game-player{position:relative;background:#16191b;border:1px solid #ffffff20;border-radius:12px;overflow:hidden;isolation:isolate}.game-frame{display:block;width:100%;height:clamp(540px,76svh,800px);border:0;background:#16191b}.player-loading{position:absolute;inset:0 0 45px;display:grid;place-items:center;margin:0;color:var(--muted);z-index:1;background:#16191b;pointer-events:none}.player-toolbar{display:flex;justify-content:space-between;align-items:center;gap:16px;min-height:48px;padding:0 16px;border-top:1px solid #ffffff20;font-size:13px;background:#25292c}.player-toolbar a,.player-toolbar button:where(:not(.game-like-button)){display:inline-flex;align-items:center;gap:10px;min-height:44px;color:var(--ink)}.player-toolbar button:where(:not(.game-like-button)){padding:0;border:0;background:none;cursor:pointer}.player-toolbar a:hover,.player-toolbar button:where(:not(.game-like-button)):hover{color:var(--accent)}.game-player:fullscreen{width:100%;height:100%;border:0;border-radius:0}.game-player:fullscreen .game-frame{height:calc(100dvh - 49px)}.more-games{margin:32px 0 36px;padding-top:28px;border-top:1px solid #ffffff20}.more-games h2{font-size:22px}.more-games-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:16px;margin-top:20px}.more-game{display:flex;min-width:0;flex-direction:column;gap:6px}.more-game img{width:100%;height:auto;aspect-ratio:2/1;object-fit:cover;border:1px solid #ffffff20;border-radius:8px;transition:filter .15s ease}.more-game span{margin-top:4px;font-size:14px;font-weight:650;line-height:1.5;overflow-wrap:anywhere}.more-game small{font-size:11px;line-height:1.5;color:var(--muted)}.more-game:hover img{filter:brightness(1.12)}.more-game:hover span{color:var(--accent)}.play-information{display:flex;align-items:start;justify-content:space-between;flex-wrap:wrap;gap:8px 24px;border-block:1px solid #ffffff20;padding:12px 0}.play-information .game-language-info{max-width:640px;margin:0}.play-information summary{padding:12px 0;font-size:13px;cursor:pointer}.play-information .game-language-info p{font-size:12px;line-height:1.7}.play-information .game-related{margin:0}.game-advert{margin:180px auto;max-width:728px;min-height:120px;text-align:center}.game-advert>span{display:block;margin-bottom:12px;color:var(--muted);font-size:11px}.game-advert ins{display:block;width:100%;height:100px}.ad-privacy-choices{background:none;border:0;color:var(--muted);cursor:pointer;font-size:12px;min-height:44px}.play-main [hidden]{display:none!important}
@media(max-width:700px){.game-main.play-main{width:calc(100% - 32px)}.play-intro{grid-template-columns:auto minmax(0,1fr);gap:4px 10px;padding:4px 0 10px}.play-intro h1{font-size:18px}.play-back{padding-inline-end:10px;font-size:11px}.play-back a{min-height:32px}.play-intro p{grid-column:1/-1;max-width:none;font-size:12px;line-height:1.5}.game-frame{height:clamp(540px,76svh,740px)}.more-games-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:20px 16px}.more-games{margin-block:28px}.player-toolbar{padding-inline:12px}.game-player{border-radius:8px}.play-information{display:block}}
@media(prefers-reduced-motion:reduce){.more-game img{transition:none}}

/* Ramen viewport v4 */
.game-main.play-main.ramen-play-main{width:calc(100% - 32px);max-width:1800px}
.ramen-play-main .game-frame{height:var(--ramen-player-height,calc(100svh - 156px));min-height:440px;max-height:none}
.ramen-play-main .game-player:fullscreen .game-frame{height:calc(100dvh - 49px);min-height:0}
@media(max-width:700px){.game-main.play-main.ramen-play-main{width:calc(100% - 16px)}.ramen-play-main .play-intro{padding-bottom:6px}.ramen-play-main .play-intro p{display:none}}
/* End Ramen viewport v4 */

/* Kotoba viewport */
.game-main.play-main.kotoba-play-main{width:calc(100% - 24px);max-width:1800px}.kotoba-play-main .game-frame{height:var(--kotoba-player-height,calc(100svh - 155px));min-height:420px;max-height:none}.kotoba-play-main .game-player:fullscreen .game-frame{height:calc(100dvh - 49px);min-height:0}@media(max-width:700px){.game-main.play-main.kotoba-play-main{width:calc(100% - 16px)}.kotoba-play-main .play-intro p{display:none}}

/* Folding stage shares the game-first responsive viewport. */
[data-player="oritsuki"] .game-frame{height:var(--kotoba-player-height,740px);width:100%;}

/* Let the six-well cooking surface fill the available viewport. */
[data-player="takoyaki"] .game-frame{height:var(--kotoba-player-height,740px);width:100%;}

/* Phone and iPad: use one measured viewport for every embedded game. */
.game-player .game-frame{height:var(--player-height,76svh);min-height:0;max-height:none}
.game-player:fullscreen .game-frame{height:calc(100dvh - 49px);min-height:0}
@media(max-width:1199px){
 .play-page{padding:0;padding-inline:max(0px,env(safe-area-inset-left)) max(0px,env(safe-area-inset-right))}
 .play-page .site-shell{border:0;border-radius:0;box-shadow:none}
 .play-page .header-row{min-height:52px;gap:12px}
 .play-page .container,.game-main.play-main,.game-main.play-main.ramen-play-main,.game-main.play-main.kotoba-play-main{width:calc(100% - 16px)}
 .play-intro{grid-template-columns:auto minmax(0,1fr);gap:6px 10px;padding:4px 0 6px}
 .play-intro p{display:none}
 .play-intro h1{font-size:18px;line-height:1.25}
 .play-back{font-size:11px;padding-inline-end:10px}
 .play-back a{min-height:32px}
 .player-toolbar{--game-like-height:40px;min-height:40px;padding-inline:12px;font-size:12px}
 .player-toolbar a,.player-toolbar button{min-height:40px}
 .game-player{border-radius:8px}
 .game-guide,.game-screenshots,.game-faq{overflow-wrap:anywhere}
 .more-games-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
 .game-player:fullscreen .game-frame{height:calc(100dvh - 41px)}
}
@media(max-width:599px){
 .more-games-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 12px}
 .play-intro h1{font-size:17px}
 .more-game span{font-size:13px}
}
@media(max-height:600px) and (min-width:600px) and (max-width:1199px){
 .play-page .portal-header{display:none}
 .play-intro{padding:0;min-height:34px}
 .play-intro h1{font-size:16px}
 .play-back a{min-height:32px}
 .player-toolbar,.player-toolbar a,.player-toolbar button{min-height:32px}
 .player-toolbar{--game-like-height:32px;font-size:11px}
 .game-player{border-radius:6px}
 .game-player:fullscreen .game-frame{height:calc(100dvh - 33px)}
}

/* A single compact return control keeps the game heading clear. */
.play-back{padding-inline-end:0;border-inline-end:0}
.play-back .play-back-link{display:inline-flex;align-items:center;gap:6px;min-height:36px;padding:5px 10px;border:1px solid #ffffff26;border-radius:6px;background:#ffffff05;color:var(--muted);font-size:12px;line-height:1.2;white-space:nowrap;text-decoration:none}
.play-back-link svg{flex:none}
.play-back .play-back-link:hover{color:var(--ink);background:#ffffff0c;border-color:#ffffff45}
.play-back .play-back-link:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
[dir=rtl] .play-back-link svg{transform:scaleX(-1)}
@media(max-width:599px){.play-back .play-back-link{gap:5px;padding-inline:8px}}

.player-controls {
 display: flex;
 align-items: center;
 gap: 12px;
}

.player-controls .phone-view-button {
 display: inline-grid;
 place-items: center;
 width: 36px;
 min-height: 36px;
 border: 1px solid #ffffff26;
 border-radius: 8px;
}

.player-controls .phone-view-button:hover,
.player-controls .phone-view-button[aria-pressed="true"] {
 border-color: var(--accent);
 color: var(--accent);
 background: #ffffff0c;
}

.player-controls .phone-view-button:focus-visible {
 outline: 2px solid var(--accent);
 outline-offset: 2px;
}

@media (min-width:768px) and (hover:hover) and (pointer:fine) {
 .game-main.play-main,
 .game-main.play-main.ramen-play-main,
 .game-main.play-main.kotoba-play-main {
  width: calc(100% - 32px);
  max-width: 1040px;
 }

 .game-main.play-main.portrait-play-main {
  max-width: 700px;
 }

 .play-intro {
  grid-template-columns: auto minmax(0, 1fr);
 }

 .play-intro > p {
  display: none;
 }

 .game-player[data-view="phone"]:not(:fullscreen) {
  box-sizing: border-box;
  width: min(100%, 392px);
  margin-inline: auto;
 }

 .game-player[data-view="phone"]:not(:fullscreen) .game-frame {
  height: clamp(540px, var(--player-height, 76svh), 844px);
 }
}

@media (min-width:1200px) and (hover:hover) and (pointer:fine) {
 .play-main:not(.portrait-play-main) .play-intro {
  grid-template-columns: auto auto minmax(0, 1fr);
 }

 .play-main:not(.portrait-play-main) .play-intro > p {
  display: block;
 }
}

/* Fill the tablet while letting each game use its compact controls when height permits. */
html[data-ipad] .play-page {
 padding: 0 max(0px, env(safe-area-inset-right)) 0 max(0px, env(safe-area-inset-left));
}
html[data-ipad] .play-page .site-shell {
 border: 0;
 border-radius: 0;
 box-shadow: none;
}
html[data-ipad] .game-main.play-main {
 width: calc(100% - 16px);
 max-width: none;
}
html[data-ipad] .game-player {
 display: grid;
 grid-template: var(--player-height, 76svh) auto / minmax(0, 1fr);
}
html[data-ipad] .game-main .game-player .game-frame {
 grid-area: 1 / 1;
 place-self: start center;
 width: var(--tablet-width, 100%);
 height: var(--tablet-height, var(--player-height, 76svh));
 min-height: 0;
 max-width: none;
 transform: scale(var(--tablet-scale, 1));
 transform-origin: top center;
}
html[data-ipad] .player-toolbar { grid-area: 2 / 1; }

.mobile-game-ranks,
.mobile-game-menu,
.mobile-game-meta { display: none; }

html[data-mobile-game] .play-page .portal-header,
[data-mobile-game] .play-intro > p { display: none; }

[data-mobile-game] .game-player:not(:fullscreen) > .player-toolbar {
 --game-like-height: 44px;
 min-height: 45px;
 justify-content: flex-end;
}

[data-mobile-game] .game-player:not(:fullscreen) > .player-toolbar > a,
[data-mobile-game] .game-player:not(:fullscreen) .player-controls > button { display: none; }

[data-mobile-game] .play-intro {
 position: relative;
 z-index: 2;
 grid-template-columns: auto minmax(0, 1fr) auto auto;
 min-height: 54px;
 gap: 6px;
 padding: 4px 0;
}
[data-mobile-game] .play-heading { display: block; }
[data-mobile-game] .play-heading h1 {
 overflow: hidden;
 text-overflow: ellipsis;
 white-space: nowrap;
 font-size: 16px;
}
[data-mobile-game] .play-back-link,
[data-mobile-game] .mobile-game-ranks,
[data-mobile-game] .mobile-game-menu > summary {
 display: flex;
 align-items: center;
 justify-content: center;
 min-height: 44px;
 gap: 5px;
 padding: 0 8px;
 border: 1px solid #4a5347;
 border-radius: 8px;
 background: #1b221c;
 color: var(--ink);
 font: inherit;
 font-size: 12px;
 font-weight: 650;
 white-space: nowrap;
 cursor: pointer;
}
[data-mobile-game] .play-back-link { padding-inline: 9px; }
[data-mobile-game] .play-back-link svg { display: none; }
[data-mobile-game] .play-back-link::before { content: "‹"; font-size: 21px; line-height: .85; }
[data-mobile-game] .play-intro[dir="rtl"] .play-back-link::before { content: "›"; }
[data-mobile-game] .mobile-game-ranks { color: #fff4de; background: #9f351f; border-color: #b3452b; }
[data-mobile-game] .mobile-game-ranks :first-child { font-size: 15px; }
[data-mobile-game] .mobile-game-menu { display: block; min-width: 44px; }
[data-mobile-game] .mobile-game-menu > summary { font-size: 24px; line-height: 1; list-style: none; }
.mobile-game-menu > summary::-webkit-details-marker { display: none; }
.mobile-game-menu[open] > summary { border-color: #c5da76; }
.mobile-game-ranks:disabled,
.mobile-game-option:disabled { opacity: .65; cursor: default; }
.mobile-game-menu :focus-visible,
.mobile-game-ranks:focus-visible { outline: 2px solid #d5e998; outline-offset: 2px; }

.mobile-game-options {
 position: absolute;
 inset-block-start: calc(100% - 1px);
 inset-inline-end: 0;
 box-sizing: border-box;
 display: grid;
 width: min(100%, 270px);
 max-height: max(88px, calc(var(--player-height, 100svh) - 16px));
 max-height: max(88px, calc(100dvh - 76px));
 padding: 5px 9px;
 overflow: auto;
 overscroll-behavior: contain;
 border: 1px solid #535c4f;
 border-radius: 10px;
 background: #1c241f;
 color: #f4f3ec;
 box-shadow: 0 8px 24px #0008;
}
.mobile-game-options :is(.mobile-game-option, .history-button:not([hidden])) {
 display: flex;
 align-items: center;
 justify-content: space-between;
 gap: 8px;
 width: 100%;
 min-width: 0;
 min-height: 44px;
 margin: 0;
 padding: 2px 6px;
 border: 0;
 border-radius: 0;
 background: transparent;
 color: inherit;
 font: inherit;
 font-size: 14px;
 text-align: start;
 text-decoration: none;
}
.mobile-game-options > :not(:last-child) { border-bottom: 1px solid #ffffff20; }
.mobile-game-options .history-button:not([hidden]) { flex-direction: row-reverse; }
.mobile-game-option select {
 width: 53%;
 min-height: 39px;
 padding-inline: 5px;
 border: 1px solid #687165;
 border-radius: 5px;
 background: #2a322c;
 color: inherit;
 font-size: 16px;
}
.mobile-game-sound-state {
 width: 9px;
 height: 9px;
 border: 1px solid #a2b691;
 border-radius: 50%;
}
[aria-pressed="true"] > .mobile-game-sound-state { background: #c5da76; }

[data-mobile-game] .game-player {
 --player-height: max(0px, calc(100svh - 109px));
 overflow-anchor: none;
}
[data-mobile-game] .game-player > .player-loading { inset: 0; }
[data-mobile-game] .mobile-game-meta { display: block; }
[data-mobile-game] .mobile-game-meta .game-updated { margin: 5px 0; }

[data-mobile-game] .play-intro:not(:has(.mobile-game-ranks)) {
 grid-template-columns: auto minmax(0, 1fr) auto;
}

[data-mobile-game] .play-back-link:dir(rtl)::before { content: "›"; }

@media (max-width: 360px) {
 [data-mobile-game] .play-intro { gap: 5px; }
 [data-mobile-game] .play-heading h1 { font-size: 15px; }
}

/* Half Cut also sizes its iframe in legacy desktop layouts. */
html[data-mobile-game] [data-player="half-cut"] .game-frame {
 height: var(--player-height, 85svh) !important;
}
html[data-mobile-game][data-ipad] [data-player="half-cut"] .game-frame {
 height: var(--tablet-height, var(--player-height, 85svh)) !important;
}
