.scribble-page { padding-bottom: 4rem; }
.scribble-header, .scribble-main { width: min(96%, 1380px); margin: 0 auto; }
.scribble-header { position: relative; padding: 2.5rem 0 2rem; text-align: center; }
.scribble-header h1, .scribble-header p { margin: 0.2rem 0; }
.back-link { position: absolute; top: 2.5rem; left: 0; color: var(--blue); text-decoration: none; }
.connection-status { display: inline-block; margin-top: 1rem; padding: 0.25rem 0.7rem; border: 1px solid rgb(0 170 255 / 35%); border-radius: 999px; color: var(--muted-blue); font-size: 0.8rem; }
.connection-status.connected { color: #7ce8ae; border-color: rgb(124 232 174 / 55%); }
.connection-status.disconnected { color: #ff8e9e; border-color: rgb(255 142 158 / 55%); }
.scribble-main { opacity: 1; animation: none; }
.scribble-dashboard, .lobby-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.panel { padding: 1.5rem; border: 1px solid var(--neon-blue); border-radius: 10px; background: rgb(6 18 37 / 88%); box-shadow: 0 0 12px rgb(0 170 255 / 40%); }
.panel h2, .panel h3 { margin: 0.35rem 0 1.1rem; }
.panel-heading, .lobby-topbar, .player-item, .room-item, .scribble-status { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
label { display: grid; gap: 0.35rem; margin-bottom: 1rem; color: var(--soft-blue); font-size: 0.9rem; }
input, textarea, select { width: 100%; padding: 0.72rem; border: 1px solid rgb(0 170 255 / 55%); border-radius: 5px; color: var(--soft-blue); background: #020b18; font: inherit; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--neon-blue); box-shadow: 0 0 12px rgb(0 170 255 / 45%); }
.form-row, .join-code-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; align-items: end; }
.form-hint { color: var(--muted-blue); font-size: 0.78rem; }
.check-label { display: flex; align-items: center; gap: 0.6rem; }
.check-label input { width: auto; }
.wordlist-fieldset { margin: 0 0 1rem; padding: 0.8rem; border: 1px solid rgb(0 170 255 / 35%); border-radius: 7px; }
.wordlist-fieldset legend { padding: 0 0.35rem; color: var(--soft-blue); }
.wordlist-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.55rem; }
.wordlist-option { display: flex; align-items: center; gap: 0.55rem; margin: 0; padding: 0.55rem; border: 1px solid rgb(0 170 255 / 20%); border-radius: 5px; background: rgb(2 11 24 / 60%); cursor: pointer; }
.wordlist-option input { width: auto; }
.wordlist-option span { display: grid; gap: 0.1rem; }
.wordlist-option small { color: var(--muted-blue); }
.join-code-form label { margin: 0; }
.join-code-button { align-self: end; width: 100%; min-height: 49px; margin-top: 0; text-align: center; }
.icon-button { display: grid; width: 2.6rem; height: 2.6rem; padding: 0.65rem; border: 1px solid rgb(0 170 255 / 55%); border-radius: 50%; place-items: center; color: var(--soft-blue); background: #061a34; cursor: pointer; }
.icon-button svg { width: 100%; fill: currentcolor; }
.refresh-button.is-refreshing svg { animation: refresh-spin 650ms ease; }
.room-list, .player-list { display: grid; gap: 0.7rem; }
.room-item, .player-item { padding: 0.85rem; border: 1px solid rgb(0 170 255 / 28%); border-radius: 7px; background: rgb(2 11 24 / 75%); }
.room-item h3, .room-item p, .player-item p { margin: 0; }
.room-item h3, .room-item p, .player-item p, .score-player strong, .chat-message strong, .finish-player strong, .round-result-player strong:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-meta, .empty-state { color: var(--muted-blue); font-size: 0.82rem; }
.empty-state { padding: 1.5rem; text-align: center; border: 1px dashed rgb(0 170 255 / 35%); border-radius: 7px; }
.host-badge, .guessed-badge { padding: 0.15rem 0.5rem; border: 1px solid var(--neon-blue); border-radius: 999px; font-size: 0.7rem; text-transform: uppercase; }
.guessed-badge { color: #7ce8ae; border-color: #7ce8ae; }
.lobby-topbar { margin-bottom: 1rem; }
.start-area { margin-top: 1rem; padding: 1rem; text-align: center; border: 1px solid rgb(0 170 255 / 35%); border-radius: 8px; }
.scribble-status { margin-bottom: 1rem; padding: 0.8rem 1rem; border: 1px solid rgb(0 170 255 / 35%); border-radius: 8px; background: rgb(6 18 37 / 82%); }
.scribble-status h2, .scribble-status p { margin: 0; }
.scribble-timer { min-width: 4rem; padding: 0.45rem 0.7rem; border: 1px solid var(--neon-blue); border-radius: 999px; text-align: center; font-size: 1.25rem; font-weight: bold; }
.word-choice { margin-bottom: 1rem; padding: 1.2rem; text-align: center; border: 1px solid var(--neon-blue); border-radius: 8px; }
.word-choice h2 { margin-top: 0; }
.word-choice div { display: flex; justify-content: center; gap: 0.7rem; flex-wrap: wrap; }
.word-choice button { padding: 0.7rem 1rem; border: 1px solid var(--neon-blue); border-radius: 5px; color: var(--soft-blue); background: #061a34; cursor: pointer; }
.scribble-game { position: relative; }
.scribble-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr) 300px; gap: 1rem; align-items: stretch; }
.scribble-scoreboard, .chat-panel, .canvas-panel { border: 1px solid rgb(0 170 255 / 40%); border-radius: 9px; background: rgb(6 18 37 / 82%); overflow: hidden; }
.score-player { display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 0.5rem; padding: 0.75rem; border-bottom: 1px solid rgb(0 170 255 / 20%); }
.score-player.drawer { background: rgb(0 170 255 / 12%); }
.score-player strong { color: var(--soft-blue); }
.score-player span:last-child { grid-column: 1 / -1; color: var(--muted-blue); font-size: 0.72rem; }
.canvas-panel { display: flex; flex-direction: column; padding: 0.7rem; }
#drawing-canvas { display: block; width: 100%; aspect-ratio: 3 / 2; border-radius: 5px; background: #fff; touch-action: none; cursor: crosshair; }
#drawing-canvas.fill-cursor { cursor: cell; }
.drawing-tools { display: flex; align-items: center; gap: 0.55rem; margin-top: 0.7rem; flex-wrap: wrap; }
.drawing-tools button, .drawing-tools select { width: auto; padding: 0.5rem; border: 1px solid rgb(0 170 255 / 45%); border-radius: 5px; color: var(--soft-blue); background: #061a34; cursor: pointer; }
.color-tools { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.color-tool { width: 1.8rem; height: 1.8rem; padding: 0; border: 2px solid transparent; border-radius: 50%; cursor: pointer; }
.color-tool.active { border-color: var(--neon-blue); box-shadow: 0 0 8px var(--neon-blue); }
.tool-button, .palette-tool { position: relative; display: grid; width: 2.45rem; height: 2.45rem; flex: 0 0 auto; padding: 0.52rem; place-items: center; }
.tool-button svg, .palette-tool svg { width: 100%; height: 100%; fill: currentcolor; pointer-events: none; }
.tool-button.active { border-color: var(--neon-blue); color: #fff; box-shadow: 0 0 10px rgb(0 170 255 / 65%); }
.tool-button::after, .palette-tool::after { content: attr(data-tooltip); position: absolute; z-index: 20; top: calc(100% + 0.45rem); left: 50%; padding: 0.3rem 0.45rem; border: 1px solid rgb(0 170 255 / 45%); border-radius: 4px; color: var(--soft-blue); background: #020b18; font-size: 0.7rem; white-space: nowrap; opacity: 0; pointer-events: none; transform: translate(-50%, -4px); transition: opacity 140ms ease, transform 140ms ease; }
.tool-button:hover::after, .tool-button:focus-visible::after, .palette-tool:hover::after, .palette-tool:focus-within::after { opacity: 1; transform: translate(-50%, 0); }
.palette-tool { gap: 0; margin: 0; border: 1px solid rgb(0 170 255 / 45%); border-radius: 5px; color: var(--soft-blue); background: #061a34; cursor: pointer; }
.palette-tool input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; opacity: 0; cursor: pointer; }
.chat-panel { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; height: 100%; }
.chat-list { min-height: 0; padding: 0.7rem; overflow-y: auto; }
.chat-message { margin: 0 0 0.55rem; padding-bottom: 0.45rem; border-bottom: 1px solid rgb(0 170 255 / 12%); color: #8b98aa; word-break: break-word; }
.chat-message.system { color: var(--muted-blue); font-style: italic; }
.chat-message.success { color: #66ff8f; font-style: italic; font-weight: bold; text-shadow: 0 0 8px rgb(102 255 143 / 42%); }
.chat-message strong { color: var(--soft-blue); }
#chat-form { display: grid; grid-template-columns: 1fr auto; border-top: 1px solid rgb(0 170 255 / 30%); }
#chat-form input, #chat-form button { border: 0; border-radius: 0; }
#chat-form button { padding: 0.7rem; color: var(--soft-blue); background: #061a34; cursor: pointer; }
.finish-view { padding: 1.5rem; text-align: center; border: 1px solid var(--neon-blue); border-radius: 10px; background: rgb(6 18 37 / 88%); }
.finish-list { display: grid; gap: 0.7rem; max-width: 600px; margin: 1rem auto; }
.finish-player { display: flex; justify-content: space-between; padding: 0.8rem; border: 1px solid rgb(0 170 255 / 30%); border-radius: 7px; }
.round-result { position: fixed; z-index: 90; inset: 0; display: grid; padding: 1.5rem; place-items: center; background: rgb(1 7 17 / 76%); backdrop-filter: blur(4px); }
.round-result-card { width: min(92vw, 520px); padding: 1.7rem; border: 1px solid var(--neon-blue); border-radius: 12px; text-align: center; background: #061225; box-shadow: 0 0 30px rgb(0 170 255 / 45%); animation: result-arrive 260ms ease-out; }
.round-result-card h2 { margin: 0 0 0.35rem; color: var(--soft-blue); }
.round-result-card p { margin: 0 0 1rem; color: var(--muted-blue); }
.round-result-list { display: grid; gap: 0.55rem; }
.round-result-player { display: flex; justify-content: space-between; gap: 1rem; padding: 0.7rem 0.85rem; border: 1px solid rgb(0 170 255 / 28%); border-radius: 6px; background: rgb(2 11 24 / 70%); }
.round-result-player strong:last-child { color: #66ff8f; }
.hidden { display: none; }
.toast { position: fixed; right: 1rem; bottom: 1rem; padding: 0.8rem 1rem; border: 1px solid var(--neon-blue); border-radius: 6px; color: var(--soft-blue); background: #061225; opacity: 0; transform: translateY(10px); transition: 180ms ease; }
.toast.visible { opacity: 1; transform: translateY(0); }
button:disabled, input:disabled, textarea:disabled, select:disabled { opacity: 0.5; cursor: not-allowed; }
@keyframes refresh-spin { to { transform: rotate(360deg); } }
@keyframes result-arrive { from { opacity: 0; transform: translateY(16px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (max-width: 1050px) { .scribble-layout { grid-template-columns: 1fr 280px; } .scribble-scoreboard { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
@media (max-width: 760px) { .scribble-dashboard, .lobby-grid, .form-row, .join-code-form, .scribble-layout { grid-template-columns: 1fr; } .back-link { position: static; display: block; margin-bottom: 1rem; } }
