body { overflow: hidden; }

#game-wrapper {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #080c14;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    user-select: none;
    -webkit-user-select: none;
}

#hud {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    min-height: 52px;
    flex-shrink: 0;
    gap: 12px;
}

#hud-players {
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
}

.hp {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 16px;
    opacity: 0.45;
    transition: opacity 0.3s;
    white-space: nowrap;
}
.hp.active { opacity: 1; font-weight: 600; }
.hp.dead { opacity: 0.2; text-decoration: line-through; }

.pd {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}

#hud-turn { font-size: 15px; color: #94a3b8; white-space: nowrap; font-weight: 500; }

#canvas-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

canvas { display: block; }

#status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 12px;
    background: rgba(0,0,0,0.5);
    color: #94a3b8;
    font-size: 13px;
    flex-shrink: 0;
    min-height: 36px;
    gap: 12px;
}

#status-text { flex: 1; }

#end-turn-btn {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 6px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
    font-family: inherit;
}
#end-turn-btn:hover { background: #2563eb; }
#end-turn-btn:disabled { background: #1e293b; color: #475569; cursor: not-allowed; }

.overlay {
    position: fixed;
    top: 64px; left: 0; right: 0; bottom: 0;
    background: rgba(8, 12, 20, 0.96);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
}
.overlay.show { display: flex; }

.oc {
    text-align: center;
    color: white;
    max-width: 460px;
    width: 90%;
    padding: 28px 20px;
}

.oc h1 {
    font-size: 40px;
    margin: 0 0 4px;
    font-family: 'Lora', Georgia, serif;
}
.oc h2 {
    font-size: 16px;
    margin: 0 0 20px;
    color: #94a3b8;
    font-weight: 400;
    line-height: 1.4;
}

.og {
    margin: 12px 0;
    text-align: left;
}
.og label {
    display: block;
    color: #475569;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 5px;
    font-weight: 600;
}

.obs { display: flex; gap: 5px; }
.ob {
    flex: 1;
    padding: 8px 10px;
    background: #111827;
    border: 2px solid #1e293b;
    color: #94a3b8;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
    font-family: inherit;
}
.ob:hover { border-color: #334155; }
.ob.sel { border-color: #3b82f6; background: #172554; color: white; }

.gbtn {
    display: inline-block;
    padding: 11px 32px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    text-decoration: none;
    transition: background 0.2s;
    font-family: inherit;
}
.gbtn:hover { background: #2563eb; }
.gbtn.sec { background: #1e293b; }
.gbtn.sec:hover { background: #334155; }

.btn-row { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }

.sg {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 16px 0;
}
.sc {
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    padding: 10px;
}
.sl { color: #475569; font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; }
.sv { font-size: 20px; font-weight: 700; margin-top: 2px; }

.rules {
    color: #475569;
    font-size: 12px;
    line-height: 1.5;
    margin-top: 10px;
    text-align: left;
    background: rgba(255,255,255,0.02);
    border-radius: 8px;
    padding: 10px 12px;
}

@media (max-width: 640px) {
    #hud { padding: 6px 10px; min-height: 44px; }
    .hp { font-size: 14px; gap: 5px; }
    .pd { width: 12px; height: 12px; }
    #hud-players { gap: 10px; }
    #hud-turn { font-size: 13px; }
    #status-bar { font-size: 11px; padding: 4px 8px; }
    #end-turn-btn { padding: 5px 12px; font-size: 11px; }
    .oc h1 { font-size: 30px; }
    .oc h2 { font-size: 14px; }
    .oc { padding: 16px 12px; }
    .obs { flex-wrap: wrap; }
    .ob { padding: 7px 8px; font-size: 12px; }
}
