/* ============================================================
   CC LITE — PLAY (player-facing lobby) — Styles
   Mobile-first: players join from a texted link on their phone.
   ============================================================ */

* { box-sizing: border-box; }

body {
    margin: 0; padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a2e; color: #eee;
    min-height: 100vh;
}

/* --- Header --- */
.play-header {
    text-align: center; padding: 1.4rem 1rem .6rem;
}
.play-logo { font-size: 2rem; line-height: 1; }
.play-header h1 {
    margin: .3rem 0 0; font-family: 'Georgia', serif;
    color: #e2c044; font-size: 1.3rem;
}
.play-header h1 span { color: #aaa; font-weight: 400; }

/* --- Layout --- */
.play-main { max-width: 640px; margin: 0 auto; padding: 1rem 1rem 3rem; }
.play-view { display: none; }
.play-view.active { display: block; }

.play-card {
    background: #16213e; border: 1px solid #2a2a4a; border-radius: 14px;
    padding: 1.4rem 1.3rem; margin-bottom: 1rem;
    box-shadow: 0 4px 16px rgba(0,0,0,.3);
}
.play-card h2 { margin: 0 0 .5rem; color: #e2c044; font-family: 'Georgia', serif; font-size: 1.25rem; }
.play-card h3 { margin: 0 0 .4rem; color: #e2c044; font-size: 1rem; }
.muted { color: #99a; font-size: .9rem; line-height: 1.5; margin: 0 0 1rem; }
.muted.small { font-size: .78rem; }
.game-code {
    font-family: monospace; background: #0f1629; border-radius: 6px;
    padding: .1em .4em; color: #e2c044; letter-spacing: 2px;
}
.error-msg { color: #f66; font-size: .85rem; margin: .5rem 0; }

/* --- Buttons & inputs --- */
.btn {
    display: inline-block; padding: .6rem 1.2rem; border: none;
    border-radius: 10px; font-size: .95rem; cursor: pointer;
    font-weight: 700; transition: all .15s;
    text-decoration: none; text-align: center;
}
.btn-primary { background: #e2c044; color: #1a1a2e; }
.btn-primary:hover { background: #d4a82a; }
.btn-secondary { background: #3a506b; color: #eee; }
.btn-secondary:hover { background: #4a6a8b; }
.btn-big { width: 100%; padding: .85rem 1.2rem; font-size: 1.05rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.play-input {
    width: 100%; padding: .75rem .9rem;
    background: #0f1629; border: 1px solid #333;
    color: #eee; border-radius: 10px; font-size: 1rem;
    margin-bottom: .8rem;
}
.play-input:focus { outline: none; border-color: #e2c044; }

/* --- Board choices --- */
.pick-header h2 { margin: 0 0 .3rem; color: #e2c044; font-family: 'Georgia', serif; }
.board-choices { display: flex; flex-direction: column; gap: .8rem; margin: 1rem 0; }
.board-choice {
    background: #16213e; border: 2px solid #2a2a4a; border-radius: 14px;
    padding: 1rem 1.1rem;
    display: flex; align-items: center; gap: 1rem;
    transition: all .15s;
}
.board-choice.available { cursor: pointer; }
.board-choice.available:hover { border-color: #e2c044; transform: translateY(-1px); }
.board-choice.taken { opacity: .45; }
.board-choice.mine { border-color: #27ae60; }
.board-choice-info { flex: 1; min-width: 0; }
.board-choice-info h3 { margin: 0 0 .2rem; color: #eee; font-size: 1.05rem; }
.board-choice-info .board-desc { color: #99a; font-size: .82rem; line-height: 1.4; margin: 0 0 .25rem; }
.board-choice-info .board-meta { color: #667; font-size: .74rem; }
.board-choice .board-status {
    flex: 0 0 auto; font-size: .78rem; font-weight: 700;
    text-align: right;
}
.board-choice .board-status .taken-by { color: #c0392b; }
.board-choice .board-status .mine-tag { color: #27ae60; }
.no-boards { color: #99a; text-align: center; padding: 1.5rem 0; }

/* --- Rosters --- */
.roster { display: flex; flex-direction: column; gap: .5rem; margin-bottom: 1rem; }
.roster-row {
    display: flex; align-items: center; gap: .7rem;
    background: #0f1629; border-radius: 10px; padding: .6rem .8rem;
}
.roster-row .player-dot {
    width: 12px; height: 12px; border-radius: 50%;
    background: #e2c044; flex: 0 0 auto;
}
.roster-row .player-dot.waiting { background: #555; }
.roster-row .player-name { font-weight: 700; }
.roster-row .player-board { color: #99a; font-size: .82rem; margin-left: auto; text-align: right; }
.roster-row.me .player-name { color: #e2c044; }
.mini-roster { color: #778; font-size: .8rem; text-align: center; margin-top: 1rem; }

.lobby-actions { display: flex; gap: .6rem; }

/* --- Share --- */
.share-row { display: flex; gap: .5rem; }
.share-row .play-input { margin-bottom: 0; flex: 1; min-width: 0; font-size: .8rem; }

/* ============================================================
   IN-GAME
   ============================================================ */
.game-topbar {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: .8rem; flex-wrap: wrap; gap: .4rem;
}
.game-round { color: #e2c044; font-weight: 800; font-family: 'Georgia', serif; font-size: 1.05rem; }
.game-phase { color: #99a; font-size: .85rem; font-weight: 700; }

/* Face-up cards */
.cards-label { color: #99a; font-size: .78rem; margin-bottom: .4rem; }
.cards-strip {
    display: flex; gap: .6rem; overflow-x: auto; padding-bottom: .5rem;
    margin-bottom: .6rem;
}
.card-chip {
    flex: 0 0 150px; border: 2px solid #888; border-radius: 10px;
    background: #f6f1e7; overflow: hidden; color: #222;
}
.card-chip-title {
    font-size: .72rem; font-weight: 800; padding: .3rem .4rem;
    line-height: 1.15;
}
.card-chip-body { padding: .4rem; display: flex; flex-direction: column; gap: .3rem; }
.card-chip-slots { font-size: .68rem; color: #555; line-height: 1.3; }
.card-chip-vp { font-size: .78rem; font-weight: 800; color: #a07c10; }
.waiting-note { color: #99a; font-size: .85rem; margin: .5rem 0; }
.hint-note { color: #99a; font-size: .8rem; margin: .4rem 0; }

/* Opponents strip */
.game-opponents { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .8rem; }
.opp-chip {
    background: #16213e; border: 1px solid #2a2a4a; border-radius: 10px;
    padding: .4rem .6rem; font-size: .74rem;
    display: flex; flex-direction: column; gap: .1rem;
}
.opp-chip .opp-name { font-weight: 700; }
.opp-chip .opp-stats { color: #99a; }

/* My board */
.my-board-label { color: #e2c044; font-weight: 700; font-size: .85rem; margin-bottom: .4rem; }
.my-board-label .my-stats { color: #99a; font-weight: 400; font-size: .76rem; }
.pb-row {
    display: flex; align-items: center; gap: .4rem;
    border-radius: 8px; padding: .35rem .5rem; margin-bottom: .35rem;
}
.pb-row-name {
    font-size: .62rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: 1px; min-width: 52px; line-height: 1.1;
}
.pb-slots { display: flex; gap: .3rem; flex: 1; justify-content: space-around; }
.pb-slot {
    width: 34px; height: 34px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,.4);
    display: flex; align-items: center; justify-content: center;
    font-size: .8rem; font-weight: 800; flex: 0 0 auto;
    overflow: hidden;
}
.pb-slot.pb-filled { border-color: rgba(255,255,255,.85); box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.pb-slot.pb-bad { background: #1a1a24; color: #e74c3c; border-color: #e74c3c; }
.pb-slot.pb-legal {
    cursor: pointer;
    border-color: #fff;
    box-shadow: 0 0 8px 2px rgba(255,255,255,.75);
    animation: pulse 1.2s infinite;
}
@keyframes pulse {
    0%, 100% { box-shadow: 0 0 6px 1px rgba(255,255,255,.55); }
    50% { box-shadow: 0 0 10px 3px rgba(255,255,255,.95); }
}
[data-wildrow] { cursor: pointer; text-decoration: underline; }
.limbo-note { color: #99a; font-size: .76rem; margin: .3rem 0 .6rem; }

/* Hand & actions */
.game-actions { margin: 1rem 0; }
.action-row { display: flex; flex-direction: column; gap: .6rem; }
.hand-label { color: #e2c044; font-size: .85rem; font-weight: 700; margin-bottom: .4rem; }
.hand-row { display: flex; gap: .6rem; flex-wrap: wrap; }
.hand-token {
    width: 54px; height: 54px; border-radius: 50%;
    border: 3px solid rgba(255,255,255,.5);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem; font-weight: 800; cursor: pointer;
    position: relative; flex: 0 0 auto;
    box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.hand-token.sel { border-color: #e2c044; box-shadow: 0 0 10px rgba(226,192,68,.8); transform: scale(1.08); }
.hand-token .ht-side {
    position: absolute; bottom: 2px; right: 6px;
    font-size: .55rem; opacity: .7;
}
.hand-token.bad {
    background: #1a1a24; color: #e74c3c; border-color: #e74c3c;
    font-size: 1rem; flex-direction: column;
}
.hand-token.bad .ht-label { font-size: .42rem; color: #ccc; text-align: center; line-height: 1.1; }

/* Log */
.game-log { margin-top: 1rem; border-top: 1px solid #2a2a4a; padding-top: .6rem; }
.log-label { color: #667; font-size: .68rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: .3rem; }
.log-line { color: #99a; font-size: .76rem; line-height: 1.5; }
.log-line:first-of-type { color: #ccc; }

/* --- Toasts --- */
.toast-container {
    position: fixed; top: 1rem; left: 50%; transform: translateX(-50%);
    z-index: 9999; display: flex; flex-direction: column; align-items: center; gap: .5rem;
    width: max-content; max-width: 92vw;
}
.toast {
    padding: .7rem 1.2rem; border-radius: 10px; font-size: .85rem;
    animation: toastIn .3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,.4);
}
.toast-success { background: #27ae60; color: #fff; }
.toast-error { background: #c0392b; color: #fff; }
.toast-info { background: #2980b9; color: #fff; }
@keyframes toastIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
