* { box-sizing: border-box; margin: 0; }
body { font-family: system-ui, sans-serif; background: #1d2b23; color: #eee;
       height: 100vh; display: flex; flex-direction: column; }
header { display: flex; justify-content: space-between; align-items: center;
         padding: .5rem 1rem; background: #14201a;
         border-bottom: 1px solid rgba(255,255,255,.06); }
header h1 { font-size: 1.15rem; letter-spacing: .02em; }
#me-box { display: flex; align-items: center; gap: .6rem; font-size: .95rem; }
#logout-btn { background: transparent; border: 1px solid rgba(255,255,255,.25);
              color: #bbb; border-radius: 6px; padding: .2rem .6rem;
              font-size: .8rem; cursor: pointer; }
#logout-btn:hover { color: #fff; border-color: rgba(255,255,255,.5); }
main { flex: 1; display: flex; min-height: 0; }
/* min-width:0 pe canvas + flex-shrink:0 pe panou: altfel lățimea intrinsecă a
   canvasului (setată de resize() la clientWidth×dpr) strivește panoul la zero */
#board { flex: 1; min-width: 0; touch-action: none; display: block; }
#panel { width: 320px; flex-shrink: 0; overflow-y: auto; background: #14201a;
         padding: 1rem; display: flex; flex-direction: column; gap: 1rem; }
#panel section { background: #1f3128; border-radius: 10px; padding: .9rem; }
#panel h2 { font-size: 1.05rem; margin-bottom: .55rem; }
#panel h3 { font-size: .95rem; margin: .5rem 0 .2rem; }
#panel input { width: 100%; margin-bottom: .5rem; padding: .55rem .6rem;
               border-radius: 6px; border: 1px solid #2e4a3a;
               background: #16241c; color: #eee; font-size: .95rem; }
#panel input:focus { outline: 2px solid #2a9d8f; border-color: transparent; }
#panel button { padding: .55rem .9rem; border: none; border-radius: 8px;
                background: #2a9d8f; color: #fff; cursor: pointer;
                font-size: .95rem; transition: background .15s, transform .05s; }
#panel button:hover:not(:disabled) { background: #34b3a4; }
#panel button:active:not(:disabled) { transform: scale(.97); }
#panel button:disabled { opacity: .4; cursor: default; }
#turn-box { border: 2px solid #ffd166; background: #24382c;
            box-shadow: 0 0 14px rgba(255,209,102,.15); }
#tile-preview { display: block; margin: .3rem 0; border-radius: 8px; }
#leaderboard { padding-left: 1.4rem; }
#leaderboard li { margin-bottom: .3rem; font-size: .95rem; }
#leaderboard .asleep { opacity: .5; }
#countdown { font-variant-numeric: tabular-nums; font-size: 1.35rem;
             font-weight: 600; margin: .4rem 0; }
#countdown.warn { color: #f4a261; }
#countdown.danger { color: #e63946; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.hint { font-size: .82rem; opacity: .7; margin: .4rem 0; }
#meeple-options button { display: block; width: 100%; margin: .3rem 0; text-align: left; }
#move-msg, #reg-msg { font-size: .88rem; margin-top: .4rem; }
#status-line { font-size: .95rem; }
#toasts { position: fixed; top: .8rem; right: .8rem; z-index: 10;
          display: flex; flex-direction: column; gap: .5rem; }
.toast { background: #2a9d8f; color: #fff; padding: .7rem 1rem;
         border-radius: 10px; box-shadow: 0 4px 14px rgba(0,0,0,.4);
         font-size: .95rem; animation: slidein .25s ease-out; }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }
@media (max-width: 700px) {
  main { flex-direction: column; }
  #board { min-height: 55vh; }
  #panel { width: 100%; flex: 1; }
}
