/* Let the crocodile fill the phone, including the page gutters. */
.site-information { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin: 20px 0 6px; padding-top: 17px; border-top: 1px solid var(--stroke); }
.site-information a { display: inline-flex; align-items: center; min-height: 44px; color: #b6c2be; font-size: 14px; text-decoration: underline; text-underline-offset: 4px; }
.site-information a:focus-visible { outline: 3px solid #d1f48c; outline-offset: 3px; border-radius: 4px; }
.home-install { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px; margin-top: 18px; padding: 12px 16px; border: 1px solid #42533c; border-radius: 15px; background: #1b2822; color: #d1f48c; font: inherit; font-size: 15px; font-weight: 600; }
.home-install[hidden] { display: none; }
.home-install:focus-visible { outline: 3px solid #d1f48c; outline-offset: 4px; }
#install-dialog { width: min(390px,calc(100vw - 32px)); max-height: 88svh; overflow-y: auto; padding: 24px; }
.install-icon { display: block; border-radius: 16px; margin-bottom: 18px; }
#install-description { font-size: 16px; line-height: 1.6; }
#install-steps { padding-left: 23px; margin-block: 22px; font-size: 16px; line-height: 1.7; text-align: left; }
#install-steps li { padding-left: 4px; margin-bottom: 12px; }
#install-note { font-size: 14px; line-height: 1.6; color: #aab7ae; }
#install-close { min-height: 49px; margin-top: 20px; }
#croc-game .intro { padding-top: 14px; }
.croc-stage { margin-inline: -24px; min-height: 0; padding: 8px 0; }
.croc-character { width: min(100%, 470px); flex-shrink: 0; }
.croc-mouth { left: 4%; top: 42%; width: 92%; height: 47%; border-width: 4px; padding: 2px; border-radius: 18% 18% 23% 23%; }
.teeth-row button { height: 64px; }
.teeth-row button::before { width: 88%; height: 53px; border-radius: 4px 4px 9px 9px; }
.teeth-row.lower button::before { border-radius: 9px 9px 4px 4px; }
@media (max-height: 680px) {
  .croc-stage { margin-inline: -20px; padding: 4px 0; }
  .croc-character { width: min(100%, 360px); }
  #croc-game .intro { padding-top: 12px; }
  .teeth-row button { height: 55px; }
  .teeth-row button::before { height: 45px; }
  .dice-stage { min-height: 175px; padding-block: 12px; }
  .dice-pair { min-height: 90px; }
  .result { margin-top: 13px; min-height: 45px; }
  .dice-options { margin-bottom: 3px; }
  .bottom { padding-top: 12px; }
  .footnote { margin-block: 9px 4px; }
}
.app { max-width: 520px; }
.language-tabs { display: flex; gap: 3px; padding: 4px; border: 1px solid var(--stroke); border-radius: 13px; background: #0d141a; margin-top: 2px; }
.language-tabs button { flex: 1; min-width: 0; padding: 10px 3px; min-height: 42px; background: transparent; border: 0; border-radius: 9px; color: var(--muted); font-size: 13px; }
.language-tabs button.active { background: #334139; color: var(--accent); font-weight: 750; }
.home-intro h1 span { color: inherit; }
.home-intro h1 .home-heading-dot { color: var(--accent); }
body:not([data-game=home]) .brand { min-width: 0; font-size: 18px; gap: 0; flex: 1; }
body:not([data-game=home]) #brand-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body:not([data-game=home]) .brand-mark { display: none; }
body:not([data-game=home]) .brand-dot { margin-left: 2px; }
html[lang=en] .home-intro h1, html[lang=ja] .home-intro h1 { font-size: 36px; }
html[lang=th] { line-height: 1.6; }
html[lang=th] .card-copy strong { font-size: 24px; }
html[lang=th] .home-intro h1 { font-size: 36px; }
html:not([lang=ko]) .card-description { max-width: 220px; }
.primary { padding-inline: 12px; }
html[lang=en] .primary, html[lang=ja] .primary, html[lang=th] .primary { font-size: 16px; }
.header-actions { display: flex; gap: 6px; margin-left: auto; }
.topbar { gap: 8px; }
.header-actions button { width: 49px; min-height: 50px; padding: 4px 0; border: 1px solid var(--stroke); border-radius: 13px; background: #1a252d; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.header-actions svg { width: 21px; height: 21px; fill: none; stroke: #cad6cf; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.header-actions span { font-size: 10px; color: var(--muted); }
body:not([data-game=home]) .brand { font-size: 21px; }
body:not([data-game=home]) .topbar { margin-bottom: 6px; }
.game-screen { animation: unfold .3s ease-out; }
.die { border: 0; display: block; }
.die:active { filter: brightness(1.06); }
.rolling .die { animation: tumble .48s ease-in-out infinite; }
.rolling .die:nth-child(2) { animation-name: tumble-two; }
.home-intro { padding: 30px 0 27px; }
.home-intro .eyebrow { margin-bottom: 13px; }
.home-intro h1 { font-size: 42px; line-height: 1.2; letter-spacing: -2px; }
.home-intro h1 span { color: var(--accent); }
.home-intro>p:last-child { font-size: 14px; margin: 15px 0 0; color: var(--muted); }
.game-cards { display: grid; gap: 14px; }
.game-card { min-height: 153px; width: 100%; border: 1px solid #3b5040; border-radius: 24px; background: #203329; padding: 24px; text-align: left; display: flex; align-items: center; justify-content: space-between; position: relative; overflow: hidden; }
.game-card:active { transform: scale(.98); }
.card-copy { display: flex; flex-direction: column; position: relative; z-index: 1; }
.card-tag { font-size: 11px; color: #acc2ae; margin-bottom: 8px; }
.card-copy strong { font-size: 27px; font-weight: 850; letter-spacing: -1px; }
.card-description { font-size: 12px; color: #b3c4ba; margin-top: 9px; }
.card-art { width: 105px; height: 100px; display: grid; place-items: center; flex-shrink: 0; margin-left: -10px; }
.mini-die { font-size: 100px; line-height: 1; color: #e5f5d2; transform: rotate(-15deg); text-shadow: 0 5px #82976c,0 12px 18px #0004; }
.croc-card { background: #243a36; border-color: #37554a; }
.home-croc svg { width: 133px; height: 125px; transform: rotate(9deg); }
.bomb-card { background: #3c2c2a; border-color: #60413a; }
.bomb-card .card-tag, .bomb-card .card-description { color: #ceafa0; }
.home-footer { margin: 25px 0 12px; text-align: center; color: #7f909e; font-size: 11px; }
.mini-bomb { width: 75px; height: 75px; border-radius: 50%; background: radial-gradient(circle at 30% 25%,#62707e,#2c343e 65%); border: 2px solid #7c817f; box-shadow: 0 10px 20px #0005; transform: rotate(20deg); position: relative; }
.mini-bomb::before { content: ''; position: absolute; width: 21px; height: 15px; background: #77808b; border-radius: 4px 4px 0 0; top: -12px; left: 25px; }
.mini-bomb::after { content: '✷'; font-size: 32px; color: #ffcb72; position: absolute; top: -41px; left: 29px; }
.mini-bomb span { position: absolute; width: 18px; height: 12px; top: 17px; left: 14px; border-radius: 50%; background: #fff5; transform: rotate(-35deg); }
body[data-game=bomb] .brand-mark, body[data-game=bomb] .brand-dot, body[data-game=bomb] .eyebrow { color: #ffc58b; }
.bomb-stage { flex: 1; min-height: 300px; display: grid; place-items: center; position: relative; }
.bomb-character { width: 220px; height: 250px; position: relative; transform: rotate(-9deg); }
.bomb-ball { width: 210px; height: 210px; position: absolute; bottom: 0; left: 5px; border-radius: 50%; background: radial-gradient(circle at 32% 22%,#697784,#35414d 50%,#1c2732 90%); border: 3px solid #7b8b96; box-shadow: inset -10px -15px 15px #0003,0 20px 30px #0005; }
.bomb-cap { position: absolute; width: 55px; height: 25px; background: linear-gradient(#9b9fa1,#56626a); border-radius: 9px 9px 0 0; top: 22px; left: 83px; }
.fuse { position: absolute; left: 110px; top: -12px; height: 44px; width: 45px; border: 7px solid #d6b686; border-bottom: 0; border-right: 0; border-radius: 20px 0 0 0; }
.fuse-spark { position: absolute; top: -28px; right: -20px; color: #ffd383; font-size: 48px; line-height: 1; }
.bomb-shine { position: absolute; width: 53px; height: 24px; border-radius: 50%; left: 29px; top: 31px; background: #d6e3e550; transform: rotate(-35deg); }
.bomb-eyes { position: absolute; display: flex; gap: 42px; top: 90px; left: 58px; }
.bomb-eyes i { height: 23px; width: 13px; background: #eaf2d4; border-radius: 50%; }
.bomb-mouth { position: absolute; top: 130px; left: 88px; width: 30px; height: 12px; border-bottom: 4px solid #eaf2d4; border-radius: 50%; }
.bomb-halo { width: 280px; height: 280px; border: 1px solid #ffc58b10; border-radius: 50%; position: absolute; }
.bomb-explosion { position: absolute; color: #ffd08d; font-size: 100px; font-weight: 950; left: 12px; top: 56px; transform: rotate(9deg); display: none; text-shadow: 4px 5px #743d2c; }
.bomb-status { text-align: center; }
.bomb-status .status-pill { color: #ffc58b; background: #3c2c25; border-color: #5b4131; }
.bomb-status h2 { font-size: 21px; letter-spacing: -.7px; margin: 17px 0 8px; }
.bomb-status p { font-size: 13px; color: var(--muted); margin: 0; }
.bomb-primary { background: #ffc58b; box-shadow: 0 4px #a46d44; }
.bomb-running .bomb-character { animation: ticking .25s infinite alternate; }
.bomb-running .fuse-spark { animation: sparkle .18s infinite alternate; }
.bomb-running .bomb-halo { animation: bomb-pulse 1s infinite; }
.bomb-ended .bomb-ball, .bomb-ended .bomb-cap, .bomb-ended .fuse { opacity: .15; }
.bomb-ended .bomb-explosion { display: block; animation: unfold .3s ease-out; }
::view-transition-group(game-expansion) { animation-duration: .32s; animation-timing-function: cubic-bezier(.2,.8,.2,1); }
@keyframes unfold { from { opacity: 0; transform: scale(.92) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes ticking { from { transform: rotate(-9deg); } to { transform: rotate(-5deg) translateY(-3px); } }
@keyframes sparkle { from { transform: scale(.8) rotate(0); } to { transform: scale(1.15) rotate(35deg); } }
@keyframes bomb-pulse { 50% { border-color: #ffc58b40; transform: scale(1.06); } }
@media (max-height: 740px) { .home-intro { padding: 15px 0 20px; }.home-intro h1 { font-size: 36px; }.game-card { min-height: 128px; padding: 18px 20px; }.game-cards { gap: 11px; }.home-footer { margin-top: 18px; }.card-art { height: 90px; }.bomb-stage { min-height: 240px; }.bomb-character { transform: scale(.85) rotate(-9deg); }.bomb-running .bomb-character { animation: none; } }
@media (max-width: 350px) { .game-card { padding-inline: 17px; }.card-copy strong { font-size: 24px; }.card-description { font-size: 11px; }.card-art { width: 85px; }.home-croc svg { width: 110px; }.mini-die { font-size: 85px; } }
@media (prefers-reduced-motion: reduce) { .game-screen, .bomb-running .bomb-character, .bomb-running .fuse-spark, .bomb-running .bomb-halo { animation: none; } }
.home-intro { padding-block: 22px; }
.home-intro h1 #home-heading-top, .home-intro h1 #home-heading-bottom { color: var(--ink); }
.game-card { min-height: 140px; }
.app .topbar .brand { min-width: 0; }
body:not([data-game=home]) .app .topbar .brand { font-size: 18px; }
html[lang=ja] #home-heading-top { font-size: 28px; }
@media (max-height: 740px) { .home-intro { padding-block: 15px 18px; }.game-card { min-height: 128px; } }
.language-tabs button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding-block: 8px; }
.language-tabs img { border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px #ffffff20; }
.croc-portrait-art { display: none; }
body[data-game=croc] .app { height: 100svh; min-height: 0; padding-bottom: env(safe-area-inset-bottom); }
#croc-game { position: relative; min-height: 0; }
#croc-game .intro { display: none; }
#croc-game .croc-stage { min-height: 0; padding: 0; align-items: stretch; }
#croc-game .croc-character { width: 100%; max-width: none; height: 100%; aspect-ratio: auto; }
#croc-character .croc-art { display: none; }
#croc-character .croc-portrait-art { display: block; width: 100%; height: 100%; }
#croc-game .croc-mouth { top: 29%; height: 64%; border-radius: 10% 10% 12% 12%; }
#croc-game .teeth-row button { height: clamp(56px, 13svh, 118px); }
#croc-game .teeth-row button::before { height: clamp(49px, 11.5svh, 104px); width: 91%; border-radius: 5px 5px 13px 13px; }
#croc-game .teeth-row.lower button::before { border-radius: 13px 13px 5px 5px; }
#croc-game .teeth-row button.pressed::before { transform: translateY(-110%); }
#croc-game .teeth-row.lower button.pressed::before { transform: translateY(110%); }
#croc-game .croc-status { position: absolute; top: 56%; left: 9%; right: 9%; transform: translateY(-50%); pointer-events: none; padding: 0; }
#croc-game .croc-status h2 { font-size: 19px; line-height: 1.5; margin: 12px 0 0; text-shadow: 0 2px 5px #000; }
#croc-game .croc-status>p { display: none; }
#croc-game .status-pill { font-size: 12px; background: #233c2a; }
#croc-game .snapped .croc-mouth { top: 61%; height: 3%; }
#croc-game .snap-burst { top: 56%; }
#croc-game:has(.snapped) .croc-status { top: 78%; }
@media (max-width: 350px) { #croc-game .croc-status h2 { font-size: 16px; } }
/* Spread twenty teeth around all four sides with real gaps between targets. */
#croc-game .croc-mouth { padding: 8px; }
#croc-game .teeth-row { gap: 10px; }
#croc-game .teeth-row button { height: clamp(46px,10svh,86px); }
#croc-game .teeth-row button::before { height: clamp(39px,8.8svh,76px); width: 100%; }
.teeth-side { position: absolute; top: clamp(66px,12svh,108px); bottom: clamp(66px,12svh,108px); width: clamp(42px,13vw,60px); display: grid; grid-template-rows: repeat(4,minmax(0,1fr)); gap: 15px; z-index: 2; }
.teeth-side.left { left: 7px; }
.teeth-side.right { right: 7px; }
.teeth-side button { min-height: 0; border: 0; background: none; padding: 0; display: flex; align-items: stretch; }
.teeth-side button::before { content: ''; display: block; width: 100%; height: 100%; background: linear-gradient(#fffde7,#d5dbc1); border-radius: 5px 15px 15px 5px; box-shadow: 3px 0 #a3b593; transition: opacity .15s,transform .15s; }
.teeth-side.right button::before { border-radius: 15px 5px 5px 15px; box-shadow: -3px 0 #a3b593; }
.teeth-side button.pressed::before { opacity: 0; transform: translateX(-110%); }
.teeth-side.right button.pressed::before { transform: translateX(110%); }
#croc-game .snapped .teeth-side { visibility: hidden; }
#croc-game .croc-status { left: 20%; right: 20%; }
#croc-game .croc-status h2 { font-size: 17px; }
#croc-game .status-pill { font-size: 11px; padding: 7px 8px; }
/* Fill the playable phone area with the bomb. */
body[data-game=bomb] .app { height: 100svh; min-height: 0; }
#bomb-game { min-height: 0; }
#bomb-game .intro { display: none; }
#bomb-game .bomb-stage { min-height: 0; margin-inline: -24px; overflow: hidden; }
#bomb-game .bomb-character { width: 100%; height: 100%; transform: rotate(-4deg); }
#bomb-game .bomb-ball { left: 3%; bottom: 3%; width: 94%; height: 78%; }
#bomb-game .bomb-cap { top: 14%; left: 42%; width: 16%; height: 7%; }
#bomb-game .fuse { left: 49%; top: 3%; width: 16%; height: 13%; border-width: 8px; }
#bomb-game .fuse-spark { top: -30px; right: -22px; font-size: clamp(44px,16vw,72px); }
#bomb-game .bomb-shine { left: 14%; top: 17%; width: 25%; height: 10%; }
#bomb-game .bomb-eyes { left: 28%; top: 40%; gap: 0; width: 44%; justify-content: space-between; }
#bomb-game .bomb-eyes i { width: clamp(18px,6vw,29px); height: clamp(26px,5.5svh,50px); }
#bomb-game .bomb-mouth { top: 63%; left: 42%; width: 16%; height: 8%; border-bottom-width: 7px; }
#bomb-game .bomb-halo { width: 96%; height: 88%; }
#bomb-game .bomb-explosion { top: 40%; left: 3%; width: 94%; text-align: center; font-size: clamp(60px,24vw,115px); }
#bomb-game .bomb-status h2 { margin: 10px 0 0; font-size: 19px; }
#bomb-game .bomb-status>p { display: none; }
#bomb-game .bottom { flex-shrink: 0; padding-top: 16px; }
#bomb-game.bomb-running .bomb-character { animation: large-bomb-tick .25s infinite alternate; }
@keyframes large-bomb-tick { from { transform: rotate(-4deg); } to { transform: rotate(-1deg) translateY(-2px); } }
@media(max-height:680px) { .teeth-side { gap: 9px; } #bomb-game .bomb-stage { margin-inline: -20px; } #bomb-game .bomb-status h2 { font-size: 17px; } #bomb-game .bottom { padding-top: 12px; } }
@media(max-width:350px) { #croc-game .teeth-row { gap: 8px; } #bomb-game .bomb-stage { margin-inline: -16px; } }
@media(prefers-reduced-motion:reduce) { #bomb-game.bomb-running .bomb-character { animation: none; } }
/* Give the dice the available play area, adapting to one or two dice. */
body[data-game=dice] .app { height: 100svh; min-height: 0; }
#dice-game { min-height: 0; }
#dice-game .intro { display: none; }
#dice-game .dice-stage { min-height: 0; padding: 18px 0 12px; overflow: hidden; }
#dice-game .dice-pair { flex: 1; min-height: 0; width: 100%; flex-direction: column; gap: 24px; }
#dice-game .die { width: var(--die-size,260px); height: var(--die-size,260px); flex-shrink: 0; padding: calc(var(--die-size,260px)*.17); border-radius: calc(var(--die-size,260px)*.22); }
#dice-game .die-face { gap: calc(var(--die-size,260px)*.07); }
#dice-game .result { flex-shrink: 0; min-height: 70px; margin-top: 16px; }
#dice-game .result strong { font-size: 33px; }
#dice-game .result.has-result strong { font-size: 44px; }
#dice-game .orbit-one { width: 85%; height: auto; aspect-ratio: 1; }
#dice-game .orbit-two { width: 110%; height: auto; aspect-ratio: 1; }
#dice-game .dice-options { flex-shrink: 0; margin: 4px 0 9px; gap: 10px; }
#dice-game .dice-options>span { font-size: 13px; }
#dice-game .history-section { flex-shrink: 0; }
#dice-game .bottom { flex-shrink: 0; padding-top: 16px; }
.rules-entry { display: block; margin: 11px 0 0 auto; padding: 8px 13px; min-height: 40px; border: 1px solid var(--stroke); border-radius: 12px; background: #1b2822; color: #d1f48c; font-size: 13px; }
.rules-entry::before { content: '?'; display: inline-grid; place-items: center; width: 17px; height: 17px; border: 1px solid currentColor; border-radius: 50%; margin-right: 7px; font-size: 12px; }
.dice-help { font-size: 12px; min-height: 40px; border: 0; border-radius: 9px; background: #25342b; color: var(--accent); padding: 8px 10px; margin-right: auto; }
#rules-dialog { max-height: 90svh; overflow-y: auto; padding: 24px; }
#rules-dialog>form>p { line-height: 1.6; margin-bottom: 18px; }
.rule-card { padding: 16px; background: #15221b; border: 1px solid #354a3a; border-radius: 16px; margin: 0 0 13px; }
.rule-card h3 { font-size: 16px; margin: 0 0 14px; color: var(--accent); }
.rule-line { display: flex; align-items: center; gap: 12px; margin: 10px 0 0; font-size: 14px; line-height: 1.5; }
.rule-line b { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: 8px; background: #eaf0dd; color: #24382b; font-size: 22px; }
#rules-close { margin-top: 20px; min-height: 49px; font-size: 16px; }
@media(max-height:680px) { #dice-game .history-section { display: none; } #dice-game[data-dice-count="2"] .dice-pair { flex-direction: row; gap: 18px; } #dice-game .bottom { padding-top: 12px; } #dice-game .result { min-height: 60px; margin-top: 10px; } }
@media (max-width: 350px) {
  .croc-stage { margin-inline: -16px; }
  .croc-status h2 { font-size: 18px; }
  .croc-status p { font-size: 12px; }
}
