/* fotbal.css — "Fotbal Românesc": 3D low-poly arcade football. Stage + HUD + overlays, fb- prefix.
   Structure mirrors css/arcasa.css conventions. */

#fb-stage { position: relative; width: 100%; height: 80vh; min-height: 440px; overflow: hidden; border-radius: 10px; background: #0d1a10; }
#fb-canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.fb-hidden { display: none !important; }

/* ---- overlays (menu / end) ---- */
.fb-overlay { position: absolute; inset: 0; z-index: 9; display: flex; align-items: flex-start; justify-content: center; padding: 1rem;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    background: radial-gradient(ellipse at center, rgba(10,26,16,0.82), rgba(6,12,8,0.96)); color: #fff; text-align: center; }
/* margin:auto centres the card when it fits but keeps the top reachable (scrollable) when it overflows — e.g. mobile fullscreen landscape */
.fb-card { max-width: 560px; width: 100%; margin: auto 0; }
.fb-card h3 { font-weight: 800; letter-spacing: 0.02em; margin-bottom: 0.3rem; }
.fb-card .fb-how { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 0.8rem 0; }
.fb-card .fb-how span { background: rgba(255,255,255,0.12); border-radius: 999px; padding: 0.35rem 0.9rem; font-size: 0.85rem; }
.fb-note { font-size: 0.8rem; color: #9aa3af; margin-top: 0.5rem; }
.fb-menu-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 0.4rem; }
.fb-keys { text-align: left; background: rgba(255,255,255,0.06); border-radius: 12px; padding: 0.7rem 0.9rem; margin: 0.6rem 0; max-height: 26vh; overflow-y: auto; }
.fb-keys-title { font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; font-size: 0.72rem; color: #7ef0a0; margin: 0.2rem 0 0.3rem; }
.fb-keys ul { list-style: none; margin: 0 0 0.4rem; padding: 0; }
.fb-keys li { font-size: 0.82rem; color: #d7dde6; padding: 0.15rem 0; }
.fb-keys b { color: #fff; }
#fb-end .fb-score-line { font-size: 1.5rem; font-weight: 800; color: #ffd34d; margin: 0.4rem 0; }
#fb-end .fb-end-emoji { font-size: 3rem; line-height: 1; }

/* ---- team pickers (menu) ---- */
.fb-pickers { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin: 0.9rem 0; }
.fb-picker { background: rgba(255,255,255,0.07); border-radius: 14px; padding: 0.7rem 0.6rem; width: 210px; }
.fb-picker-role { font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: #9aa3af; margin-bottom: 0.35rem; }
.fb-picker-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.fb-picker-name { flex: 1; font-weight: 800; font-size: 1.02rem; }
.fb-picker-arrow { border: 0; border-radius: 10px; width: 38px; height: 38px; font-size: 1rem; background: rgba(255,255,255,0.14); color: #fff; cursor: pointer; }
.fb-picker-arrow:active { transform: scale(0.9); }
.fb-kit { display: flex; gap: 6px; justify-content: center; margin-top: 0.5rem; }
.fb-kit span { width: 26px; height: 18px; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.35); }
.fb-clash { font-size: 0.72rem; color: #ffd34d; margin-top: 0.4rem; min-height: 1em; }
.fb-picker-wide { width: min(444px, 100%); margin: 0 auto 0.2rem; }
.fb-venue-sub { font-size: 0.76rem; color: #9aa3af; margin-top: 0.35rem; }

/* ---- HUD (click-through except buttons) ---- */
#fb-hud { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
#fb-score { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px;
    background: rgba(8,14,10,0.82); color: #fff; padding: 0.34rem 0.8rem; border-radius: 12px; font-weight: 800; }
.fb-team-dot { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.4); }
#fb-score .fb-sc { font-size: 1.15rem; letter-spacing: 0.04em; }
#fb-score .fb-sh { font-size: 0.9rem; color: #cfe0ff; }
#fb-clock { position: absolute; top: 50px; left: 50%; transform: translateX(-50%); background: rgba(8,14,10,0.72);
    color: #ffd34d; padding: 0.2rem 0.7rem; border-radius: 999px; font-weight: 800; font-size: 0.9rem; }
#fb-clock small { color: #9aa3af; font-weight: 700; margin-left: 6px; }

/* power meter (hold an action to charge) */
#fb-power { position: absolute; bottom: 58px; left: 50%; transform: translateX(-50%); width: min(48%, 320px); height: 13px; background: rgba(0,0,0,0.5); border-radius: 8px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25); pointer-events: none; }
#fb-power-bar { height: 100%; width: 0%; background: #57d968; }
/* controlled player's fitness / stamina (top-right, under the HUD buttons) */
#fb-stam { position: absolute; top: 162px; right: 10px; left: auto; width: 150px; pointer-events: none; text-align: right; }
#fb-stam small { display: block; font-size: 0.56rem; letter-spacing: 0.1em; color: #cfe8d4; margin-bottom: 2px; text-shadow: 0 1px 2px #000; }
#fb-stam-track { width: 100%; height: 8px; background: rgba(0,0,0,0.55); border-radius: 6px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2); }
#fb-stam-bar { height: 100%; width: 100%; background: linear-gradient(90deg, #57d968, #b6e84a); transition: width 0.2s linear; }
#fb-stam-bar.low { background: linear-gradient(90deg, #e74c3c, #ff8a5b); }

/* on-ball player name (top-left) */
#fb-onball { position: absolute; top: 10px; left: 10px; max-width: 46%; display: none; align-items: center; gap: 7px;
    background: rgba(8,14,10,0.82); border-left: 4px solid #57d968; border-radius: 8px; padding: 0.32rem 0.7rem 0.32rem 0.6rem;
    color: #fff; font-weight: 800; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#fb-onball.on { display: inline-flex; }
#fb-onball .fb-ob-num { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 4px;
    border-radius: 5px; background: rgba(255,255,255,0.16); font-size: 0.8rem; }
#fb-onball small { color: #9aa3af; font-weight: 700; font-size: 0.74rem; }

/* live TV commentary caption (top-left, under the on-ball label) */
#fb-comm { position: absolute; top: 48px; left: 10px; max-width: min(58%, 380px);
    background: rgba(8,14,10,0.82); color: #eaf2ea; font-size: 0.82rem; font-weight: 600; line-height: 1.32; text-align: left;
    padding: 0.4rem 0.7rem; border-radius: 9px; border-left: 3px solid #ffd34d; opacity: 0; pointer-events: none;
    transform: translateX(-6px); transition: opacity 0.22s ease, transform 0.22s ease; }
#fb-comm.on { opacity: 1; transform: translateX(0); }

/* flash (GOL! / kickoff / whistle) */
#fb-flash { position: absolute; top: 32%; left: 50%; transform: translateX(-50%); font-weight: 900; font-size: 2rem; color: #ffd34d; text-shadow: 0 2px 10px rgba(0,0,0,0.7); opacity: 0; pointer-events: none; text-align: center; }
#fb-flash.fb-pop { animation: fb-pop 1.2s ease-out; }
@keyframes fb-pop { 0% { opacity: 0; transform: translate(-50%, 10px) scale(0.6); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.2); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -20px) scale(1); } }

/* HUD buttons (fullscreen / mute) */
.fb-btn { position: absolute; pointer-events: auto; border: 0; border-radius: 8px; background: rgba(0,0,0,0.55); color: #fff; padding: 0; width: 44px; height: 44px; font-size: 1.05rem; cursor: pointer; }
.fb-btn:active { transform: scale(0.92); }
.fb-btn.on { background: rgba(46,204,113,0.75); color: #06281c; }
#btn-fb-fs { top: 10px; right: 10px; }
#btn-fb-mute { top: 60px; right: 10px; }
#btn-fb-cam { top: 110px; right: 10px; }

.fb-attrib { position: absolute; bottom: 6px; right: 8px; font-size: 0.62rem; color: rgba(255,255,255,0.55); z-index: 6; }

/* desktop controls legend */
#fb-help { position: absolute; left: 10px; bottom: 10px; pointer-events: none; max-width: 380px; text-align: left;
    background: rgba(8,14,10,0.72); color: #dfe6ea; font-size: 0.72rem; line-height: 1.35; padding: 0.45rem 0.7rem; border-radius: 9px; }
#fb-help b { color: #fff; }
#fb-help .fb-hr { display: grid; grid-template-columns: max-content 1fr; column-gap: 10px; padding: 1px 0; }
#fb-help .fb-hr > span:first-child { font-weight: 800; color: #fff; white-space: nowrap; }

/* ---- mobile touch controls ---- */
#fb-touch { position: absolute; inset: 0; pointer-events: none; z-index: 7; }
/* virtual joystick (left zone) — positioned at touch origin by JS */
#fb-joy { position: absolute; width: 132px; height: 132px; margin: -66px 0 0 -66px; display: none; pointer-events: none; }
#fb-joy.on { display: block; }
#fb-joy-base { position: absolute; inset: 0; border-radius: 50%; background: rgba(255,255,255,0.10); border: 2px solid rgba(255,255,255,0.22); }
#fb-joy-knob { position: absolute; top: 50%; left: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%; background: rgba(255,255,255,0.34); border: 2px solid rgba(255,255,255,0.4); }
/* action buttons (right zone) */
.fb-ab { position: absolute; pointer-events: auto; border: 0; border-radius: 50%; color: #fff; width: 76px; height: 76px; font-size: 1.5rem; }
.fb-ab:active { transform: scale(0.9); }
.fb-ab small { display: block; font-size: 0.5rem; letter-spacing: 0.08em; margin-top: 1px; }
#fb-b-pass { right: 134px; bottom: 42px; background: rgba(46,140,220,0.5); }   /* nudged left so it clears the big ȘUT button (spans right 40–132) */
#fb-b-up   { right: 46px;  bottom: 124px; background: rgba(46,204,113,0.5); }
#fb-b-shot { right: 40px;  bottom: 38px; width: 92px; height: 92px; font-size: 1.9rem; background: rgba(230,80,60,0.55); }
#fb-b-gk   { right: 150px; bottom: 118px; width: 66px; height: 66px; font-size: 1.25rem; background: rgba(120,130,140,0.55); }
#fb-b-skill { right: 214px; bottom: 44px; width: 66px; height: 66px; font-size: 1.25rem; background: rgba(155,89,182,0.55); }   /* just left of PASĂ (which now spans right 134–210) */

/* ---- gallery below the pitch (teams + stadiums showcase) ---- */
.fb-gallery { margin: 1.4rem auto 0; max-width: 960px; text-align: center; }
.fb-gallery-title { font-size: 1.05rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.6rem; }
.fb-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.fb-gcard { background: rgba(127,127,127,0.10); border: 1px solid rgba(127,127,127,0.18); border-radius: 12px; padding: 0.7rem 0.6rem; }
.fb-gkit { display: flex; gap: 5px; justify-content: center; margin-bottom: 0.45rem; }
.fb-gkit span { width: 30px; height: 20px; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.3); }
.fb-gname { font-weight: 700; font-size: 0.9rem; }
.fb-gsub { font-size: 0.75rem; color: #8a94a3; margin-top: 2px; }

/* short viewports (mobile fullscreen landscape): tighten the menu so it fits, and always allow scroll */
@media (max-height: 560px) {
    .fb-overlay { padding: 0.6rem; align-items: flex-start; }
    .fb-card h3 { margin-bottom: 0.15rem; font-size: 1.15rem; }
    .fb-card .fb-how { margin: 0.4rem 0; }
    .fb-keys { max-height: 30vh; }
    .fb-pickers { margin: 0.5rem 0; }
}
