/* Tumble Crate: packing-house look. Kraft, dark wood, chalk, ink. */
.tc{--tc-ink:#1b1410;--tc-card:#2a2118;--tc-edge:#4a3826;--tc-kraft:#e6cf9f;--tc-chalk:#f1e7cf;--tc-amber:#f2b134;--tc-red:#e0533d;
  background:var(--tc-card);color:var(--tc-chalk);border:2px solid var(--tc-ink);border-radius:14px;padding:10px 10px calc(10px + env(safe-area-inset-bottom));
  font-family:ui-monospace,Menlo,Consolas,"Courier New",monospace;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;box-shadow:0 4px 0 var(--tc-ink)}
.tc *{box-sizing:border-box}
.tc-hud{display:flex;align-items:center;gap:8px;min-height:44px}
.tc-level{font-weight:800;font-size:1.05rem;letter-spacing:.04em;text-transform:uppercase;flex:1}
.tc-lives{display:flex;gap:5px}
.tc-life{width:14px;height:14px;border:2px solid var(--tc-kraft);background:transparent;display:inline-block}
.tc-life.on{background:var(--tc-amber);border-color:var(--tc-amber)}
.tc-time{font-weight:800;font-size:1.25rem;min-width:3.4ch;text-align:right;font-variant-numeric:tabular-nums}
.tc-barwrap{height:8px;background:var(--tc-ink);border-radius:4px;overflow:hidden;margin:2px 0 6px}
.tc-bar{height:100%;width:100%;background:var(--tc-amber);transform-origin:left center;transform:scaleX(1)}
.tc-bar.low{background:var(--tc-red)}
.tc-hint{font-size:.8rem;line-height:1.35;min-height:2.2em;color:var(--tc-kraft)}
.tc-stage{position:relative;border-radius:10px;overflow:hidden;background:#cfae7c}
.tc-canvas{display:block;margin:0 auto;touch-action:none;cursor:grab;max-width:100%;-webkit-tap-highlight-color:transparent}
.tc-fit{font-size:.75rem;color:var(--tc-kraft);margin:8px 0 2px;min-height:1.3em;white-space:pre}
.tc-ctl{display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px;margin-top:6px}
.tc-btn,.tc-chip{font:inherit;color:var(--tc-ink);background:var(--tc-kraft);border:2px solid var(--tc-ink);border-radius:10px;min-height:48px;min-width:48px;padding:0 12px;
  font-weight:800;font-size:.95rem;letter-spacing:.03em;cursor:pointer;box-shadow:0 3px 0 var(--tc-ink);touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.tc-btn:active,.tc-chip:active{transform:translateY(3px);box-shadow:0 0 0 var(--tc-ink)}
.tc-btn:focus-visible,.tc-chip:focus-visible{outline:3px solid var(--tc-amber);outline-offset:2px}
.tc-btn.go{background:var(--tc-amber)}
.tc-btn.alt{background:#c9b88f}
.tc-row2{display:flex;gap:8px;margin-top:10px}
.tc-row2 .tc-btn{flex:1;font-size:.85rem}
.tc-mute{min-height:44px;font-size:.75rem;padding:0 10px;min-width:44px;box-shadow:0 2px 0 var(--tc-ink)}
.tc-over{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;padding:12px;overflow-y:auto;text-align:center;
  background:rgba(27,20,16,.88);animation:tcIn .22s ease-out}
.tc-over[hidden]{display:none}
#tc-cont[hidden]{display:none}
.tc-bar.low{animation:tcPulse .5s ease-in-out infinite alternate}
@keyframes tcPulse{from{opacity:1}to{opacity:.55}}
.tc-over h2{font-size:1.7rem;letter-spacing:.06em;text-transform:uppercase;color:var(--tc-amber);line-height:1.1}
.tc-over p{font-size:.85rem;line-height:1.4;max-width:30ch;color:var(--tc-chalk)}
.tc-over .tc-btn{width:min(260px,100%)}
.tc-rank{font-size:4.2rem;font-weight:900;line-height:1;color:var(--tc-chalk);text-shadow:3px 3px 0 var(--tc-red)}
.tc-rank:empty{display:none}
.tc-skins{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;max-width:300px}
.tc-chip{min-height:44px;font-size:.72rem;box-shadow:0 2px 0 var(--tc-ink)}
.tc-chip[aria-pressed="true"]{background:var(--tc-amber)}
.tc-chip:disabled{opacity:.5;cursor:default}
.tc-small{font-size:.75rem;color:var(--tc-kraft)}
.tc-how{margin-top:1rem;font-size:.9rem;line-height:1.55}
.tc-how h2{font-size:1.05rem;margin:.6rem 0 .3rem}
@keyframes tcIn{from{opacity:0;transform:scale(.97)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.tc-over{animation:none}.tc-bar.low{animation:none}.tc-btn:active,.tc-chip:active{transform:none}}
@media (max-height:700px){.tc-over h2{font-size:1.4rem}.tc-rank{font-size:3rem}}

/* Full screen: the playfield fills the stage, controls stay on screen (html.pip-immersive iPhone, html.pip-native Android) */
html.pip-immersive .game-wrap.pip-stage,html.pip-native .game-wrap.pip-stage{display:flex!important;flex-direction:column;overflow:hidden!important;padding-left:6px;padding-right:6px;padding-bottom:max(6px,env(safe-area-inset-bottom));background:#1b1410}
html.pip-native .game-wrap.pip-stage{padding-top:calc(var(--pip-dock-h,52px) + 6px + env(safe-area-inset-top,0px));width:100%;height:100%}
html.pip-immersive .game-wrap.pip-stage>.ad-well,html.pip-native .game-wrap.pip-stage>.ad-well,
html.pip-immersive .tc-how,html.pip-native .tc-how,html.pip-immersive .tc-fit,html.pip-native .tc-fit,
html.pip-immersive .tc-hint,html.pip-native .tc-hint,html.pip-immersive .tc-row2,html.pip-native .tc-row2,
html.pip-immersive .pip-actions,html.pip-native .pip-actions,html.pip-immersive .game-title,html.pip-native .game-title,
html.pip-immersive .facts,html.pip-native .facts{display:none!important}
html.pip-immersive .pip-stage .tc,html.pip-native .pip-stage .tc{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;border-radius:10px;padding:6px;margin:0;max-width:none;box-shadow:none}
html.pip-immersive .tc-stage,html.pip-native .tc-stage{flex:1 1 auto;min-height:0;position:relative}
html.pip-immersive .tc-canvas,html.pip-native .tc-canvas{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);max-width:none}
html.pip-immersive .tc-ctl,html.pip-native .tc-ctl{flex:none;margin-top:6px}
html.pip-immersive .tc-ctl .tc-btn,html.pip-native .tc-ctl .tc-btn{min-height:54px}
html.pip-immersive .tc-barwrap,html.pip-native .tc-barwrap{flex:none}
html.pip-immersive .tc-hud,html.pip-native .tc-hud{flex:none}
@media (orientation:landscape) and (max-height:520px){
  html.pip-immersive .pip-stage .tc,html.pip-native .pip-stage .tc{display:grid;grid-template-columns:minmax(0,1fr) 150px;grid-template-rows:auto auto minmax(0,1fr);gap:0 8px}
  html.pip-immersive .tc-hud,html.pip-native .tc-hud{grid-column:1/3;grid-row:1}
  html.pip-immersive .tc-barwrap,html.pip-native .tc-barwrap{grid-column:1/3;grid-row:2}
  html.pip-immersive .tc-stage,html.pip-native .tc-stage{grid-column:1;grid-row:3}
  html.pip-immersive .tc-ctl,html.pip-native .tc-ctl{grid-column:2;grid-row:3;grid-template-columns:1fr;grid-template-rows:1fr 1fr 1fr;margin-top:0}
  html.pip-immersive .tc-ctl .tc-btn,html.pip-native .tc-ctl .tc-btn{min-height:48px}
  html.pip-immersive .tc-over h2,html.pip-native .tc-over h2{font-size:1.2rem}
  html.pip-immersive .tc-over,html.pip-native .tc-over{gap:4px;padding:6px}
  html.pip-immersive .tc-over p,html.pip-native .tc-over p{font-size:.75rem;max-width:44ch}
}
