/* ==========================================================================
   RATS WITH GATS DESIGN SYSTEM & STYLESHEET
   A weathered math-magic pirate aesthetic: deep-ocean dark mode, glassmorphism,
   neon math runes, gold accents, and animated card widgets.
   ========================================================================== */

/* --- Variables & Tokens --- */
:root {
    --bg-dark: #070b12;
    --bg-ocean: #0d1726;
    --bg-ocean-light: #16243b;
    
    --gold: #d4af37;
    --gold-glow: rgba(212, 175, 55, 0.4);
    --gold-dark: #aa841c;
    
    --neon-cyan: #00f2fe;
    --neon-emerald: #00ff87;
    
    --red-suit: #ff2a5f;
    --red-glow: rgba(255, 42, 95, 0.3);
    --black-suit: #e2e8f0;
    --black-glow: rgba(226, 232, 240, 0.2);
    
    --glass-bg: rgba(13, 23, 38, 0.7);
    --glass-bg-hover: rgba(22, 36, 59, 0.85);
    --glass-border: rgba(212, 175, 55, 0.2);
    --glass-border-focus: rgba(0, 242, 254, 0.4);
    
    --text-primary: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dark: #0f172a;
    
    --font-heading: 'Cinzel', serif;
    --font-body: 'Outfit', sans-serif;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Base Reset & Setup --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: radial-gradient(circle at 50% 50%, var(--bg-ocean) 0%, var(--bg-dark) 100%);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--gold-dark);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

/* --- Layout Components --- */
.app-header {
    background: rgba(7, 11, 18, 0.95);
    border-bottom: 2px solid var(--gold);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-container h1 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 2px;
    background: linear-gradient(135deg, var(--gold) 30%, #fff 70%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 10px var(--gold-glow);
}

.math-magic {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    color: var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan), 0 0 20px var(--neon-cyan);
    animation: pulse-glow 3s infinite ease-in-out;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.player-pill {
    background: rgba(0, 242, 254, 0.1);
    border: 1px solid var(--neon-cyan);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.player-pill .bullet {
    width: 8px;
    height: 8px;
    background-color: var(--neon-emerald);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--neon-emerald);
}

.phase-pill {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.app-main {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

.app-footer {
    background: var(--bg-dark);
    padding: 1.5rem;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* --- UI Panels & Glassmorphism --- */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: var(--transition-smooth);
}

.glass-panel:hover {
    border-color: rgba(212, 175, 55, 0.35);
    box-shadow: 0 8px 32px rgba(212, 175, 55, 0.05);
}

.card {
    background: var(--bg-ocean-light);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: var(--transition-smooth);
}

.card h3 {
    font-family: var(--font-heading);
    color: var(--gold);
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    padding-bottom: 0.5rem;
}

/* --- Forms & Controls --- */
.form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 500;
}

.input-field {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(7, 11, 18, 0.8);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: var(--transition-smooth);
}

.input-field:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

.select-field {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(7, 11, 18, 0.8);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.select-field:focus {
    outline: none;
    border-color: var(--neon-cyan);
}

.input-row {
    display: flex;
    gap: 0.5rem;
}

.input-row .input-field {
    flex: 1;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: var(--text-dark);
    box-shadow: 0 4px 15px var(--gold-glow);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.6);
}

.btn-secondary {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255,255,255,0.15);
    transform: translateY(-2px);
}

.btn-deep {
    background: linear-gradient(135deg, #152238 0%, #0d1726 100%);
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    box-shadow: 0 4px 15px rgba(0, 242, 254, 0.1);
}

.btn-deep:hover:not(:disabled) {
    background: var(--neon-cyan);
    color: var(--text-dark);
    box-shadow: 0 4px 20px rgba(0, 242, 254, 0.4);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, #7a1c1c 0%, #c0392b 100%);
    color: var(--text-primary);
    box-shadow: 0 4px 15px rgba(192, 57, 43, 0.2);
}

.btn-danger:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(192, 57, 43, 0.5);
}

.btn-gold {
    background: transparent;
    border: 2px solid var(--gold);
    color: var(--gold);
    box-shadow: 0 0 10px rgba(212,175,55,0.1);
}

.btn-gold:hover:not(:disabled) {
    background: var(--gold);
    color: var(--bg-dark);
    box-shadow: 0 0 20px var(--gold-glow);
    transform: translateY(-2px);
}

.btn-full {
    width: 100%;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.glow-effect:hover {
    filter: brightness(1.2);
}

/* --- Welcome / Main Menu Screen --- */
.welcome-container {
    max-width: 900px;
    margin: 4rem auto;
}

.welcome-hero h2 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.welcome-hero .subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
}

.welcome-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .welcome-actions {
        grid-template-columns: 1fr;
    }
}

.action-card {
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 300px;
}

.action-card h3 {
    font-family: var(--font-heading);
    color: var(--gold);
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.action-card p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* --- Lobby / Hold View --- */
.lobby-view {
    max-width: 700px;
    margin: 2rem auto;
}

.lobby-view h2 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    color: var(--gold);
    margin-bottom: 0.5rem;
}

.lobby-status-box {
    margin: 2rem 0;
}

.player-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 1rem;
}

.player-chip {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 0.5rem 1.25rem;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition-smooth);
}

.player-chip.current-user {
    background: rgba(0, 242, 254, 0.15);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0,242,254,0.15);
}

.player-chip.voted-chip {
    border-color: var(--neon-emerald);
    background-color: rgba(0,255,135,0.05);
}

.player-chip.not-voted-chip {
    border-color: rgba(255,255,255,0.1);
}

.creator-badge {
    background: var(--gold);
    color: var(--text-dark);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.links-box {
    text-align: left;
    margin-bottom: 2rem;
}

.link-item {
    margin-bottom: 1.5rem;
}

.link-item h4 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.copy-container {
    display: flex;
    gap: 0.5rem;
}

.copy-input {
    flex: 1;
    background: #05080e;
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.95rem;
}

.copy-input.admin-input {
    border-color: var(--gold-dark);
    color: var(--gold);
}

.admin-link-item {
    border-top: 1px dashed rgba(212, 175, 55, 0.3);
    padding-top: 1.5rem;
}

.info-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

/* --- Character Creation & Sheet Grid --- */
.creation-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

@media (max-width: 900px) {
    .creation-grid {
        grid-template-columns: 1fr;
    }
}

.section-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.record-line {
    background: rgba(0,0,0,0.2);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    border-left: 3px solid var(--gold);
}

.delegation-box {
    margin-bottom: 1.25rem;
    padding: 1.25rem;
    text-align: left;
}

.delegation-box h4 {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.answer-box {
    font-style: italic;
    color: var(--neon-cyan);
    font-size: 1.05rem;
}

.author-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: normal;
}

.waiting-box {
    font-size: 0.9rem;
    color: var(--gold);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.inbox-list:has(.inbox-item) .inbox-empty-message {
    display: none;
}

.inbox-item {
    padding: 1rem;
    margin-bottom: 0.75rem;
    border-left: 3px solid var(--neon-cyan);
    background: rgba(0, 242, 254, 0.02);
}

.inbox-item label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.submitted-techniques .tech-chip {
    background: rgba(212,175,55,0.05);
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 0.5rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
}

.tech-chip {
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
}

.tech-assignment-pill {
    background: rgba(0, 242, 254, 0.05);
    border: 1px solid var(--neon-cyan);
    color: var(--text-primary);
    padding: 0.6rem 1rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.card-rank {
    background: var(--neon-cyan);
    color: var(--bg-dark);
    font-weight: 900;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.85rem;
}

/* --- Scene Setup / Role Choose --- */
.setup-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

@media (max-width: 800px) {
    .setup-grid {
        grid-template-columns: 1fr;
    }
}

.role-buttons {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.role-btn {
    padding: 1.5rem;
    font-size: 1.2rem;
    background: rgba(255,255,255,0.03);
    border: 2px solid rgba(255,255,255,0.1);
    color: var(--text-muted);
}

.role-btn.pirat-btn:hover, .role-btn.pirat-btn.active {
    border-color: var(--neon-emerald);
    color: var(--text-primary);
    background-color: rgba(0,255,135,0.06);
    box-shadow: 0 0 15px rgba(0,255,135,0.15);
}

.role-btn.deep-btn:hover, .role-btn.deep-btn.active {
    border-color: var(--neon-cyan);
    color: var(--text-primary);
    background-color: rgba(0,242,254,0.06);
    box-shadow: 0 0 15px rgba(0,242,254,0.15);
}

.large-badge {
    padding: 0.5rem 2rem;
    font-size: 1.5rem;
    border-radius: 8px;
    font-family: var(--font-heading);
    margin-top: 0.5rem;
}

.role-badge.deep {
    background: rgba(0, 242, 254, 0.15);
    border: 2px solid var(--neon-cyan);
    color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0,242,254,0.1);
}

.role-badge.pirat {
    background: rgba(0, 255, 135, 0.15);
    border: 2px solid var(--neon-emerald);
    color: var(--neon-emerald);
    box-shadow: 0 0 15px rgba(0,255,135,0.1);
}

.list-chips {
    justify-content: flex-start;
}

.list-chips .player-chip {
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
}

.deep-chip {
    border-color: var(--neon-cyan);
    background: rgba(0, 242, 254, 0.03);
}

.pirat-chip {
    border-color: var(--neon-emerald);
    background: rgba(0, 255, 135, 0.03);
}

/* --- Scene Play Board Layout --- */
.scene-view-layout {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 2rem;
}

@media (max-width: 1100px) {
    .scene-view-layout {
        grid-template-columns: 1fr;
    }
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.card-header h3 {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.deck-counter {
    font-size: 0.85rem;
    color: var(--gold);
    font-weight: 700;
}

/* --- Active Obstacle Item Display --- */
.obstacles-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.obstacle-item {
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 1.25rem;
    background: rgba(7, 11, 18, 0.4);
    display: grid;
    grid-template-columns: 0.8fr 2fr 1fr 1fr;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

@media (max-width: 768px) {
    .obstacle-item {
        grid-template-columns: 0.8fr 2fr 1.5fr;
    }
}

@media (max-width: 600px) {
    .obstacle-item {
        grid-template-columns: 1fr;
    }
}

/* Color theme mappings for suits */
.suit-c { border-left: 4px solid var(--black-suit); }
.suit-s { border-left: 4px solid var(--black-suit); }
.suit-h { border-left: 4px solid var(--red-suit); }
.suit-d { border-left: 4px solid var(--red-suit); }

.obstacle-meta {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0,0,0,0.3);
    border-radius: 6px;
    padding: 0.5rem;
}

.suit-badge {
    font-weight: 900;
    font-size: 1.1rem;
}

.suit-c .suit-badge, .suit-s .suit-badge { color: var(--black-suit); }
.suit-h .suit-badge, .suit-d .suit-badge { color: var(--red-suit); }

.card-code {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--font-heading);
}

.obstacle-details h4 {
    font-family: var(--font-heading);
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
}

.obstacle-details .desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.obstacle-value-display {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(212, 175, 55, 0.04);
    border: 1px dashed var(--glass-border);
    border-radius: 6px;
    padding: 0.5rem;
}

.obstacle-successes-display {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 255, 135, 0.04);
    border: 1px dashed rgba(0, 255, 135, 0.25);
    border-radius: 6px;
    padding: 0.5rem;
}

.obstacle-successes-display .val-number {
    color: var(--neon-emerald);
}

.val-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.val-number {
    font-size: 1.8rem;
    font-family: var(--font-heading);
    font-weight: 900;
    color: var(--gold);
}

.played-column {
    grid-column: span 4;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 0.75rem;
    margin-top: 0.5rem;
}

@media (max-width: 600px) {
    .played-column {
        grid-column: span 1;
    }
}

.played-column h5 {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.column-cards-flex {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

/* Card Widget (Mini) */
.card-mini {
    width: 32px;
    height: 48px;
    border-radius: 4px;
    border: 1px solid var(--text-muted);
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2px 4px;
    font-size: 0.7rem;
    font-weight: 900;
}

.card-mini.base-card {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(212,175,55,0.1);
}

.card-mini.rotated {
    transform: rotate(90deg);
    margin: 0 4px;
}

.card-mini.success {
    border-color: var(--neon-emerald);
    color: var(--neon-emerald);
}

.card-mini.failure {
    border-color: var(--red-suit);
    color: var(--red-suit);
}

.card-mini .val {
    align-self: flex-start;
}

.card-mini .suit {
    align-self: flex-end;
}

.card-mini .owner {
    font-size: 0.5rem;
    text-transform: uppercase;
    position: absolute;
    bottom: -1px;
    left: 1px;
    color: var(--text-muted);
}

/* --- Challenges Section --- */
.challenges-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.challenge-item {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 1.25rem;
    text-align: left;
}

.challenge-item h4 {
    font-family: var(--font-heading);
    color: var(--neon-cyan);
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.challenge-item .desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.applied-obstacles h5 {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.applied-obs-row {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.obs-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.obs-info .symbol {
    font-size: 1.2rem;
}

.play-card-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.select-xsmall {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    width: 140px;
    background: var(--bg-dark);
}

/* --- Deep Control panel --- */
.deep-text {
    color: var(--neon-cyan) !important;
}

.deep-divider {
    border: 0;
    height: 1px;
    background: linear-gradient(to right, rgba(0, 242, 254, 0), rgba(0, 242, 254, 0.4), rgba(0, 242, 254, 0));
    margin: 2rem 0;
}

.obstacles-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: rgba(0,0,0,0.2);
    padding: 1rem;
    border-radius: 8px;
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid var(--glass-border);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
}

/* --- Private Section & Hands --- */
.hand-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Card Widget (Medium) */
.card-medium {
    width: 75px;
    height: 112px;
    border-radius: 6px;
    border: 1.5px solid var(--glass-border);
    background: linear-gradient(135deg, var(--bg-ocean-light) 0%, var(--bg-dark) 100%);
    box-shadow: 0 3px 10px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0.3rem;
    position: relative;
    font-size: 0.85rem;
}

.card-medium .card-corner {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}

.card-medium .card-corner .val {
    font-weight: 900;
    font-size: 0.9rem;
}

.card-medium .card-corner .suit {
    font-size: 0.75rem;
}

.card-medium.suit-c, .card-medium.suit-s {
    border-color: rgba(226, 232, 240, 0.15);
}

.card-medium.suit-h, .card-medium.suit-d {
    border-color: rgba(255, 42, 95, 0.15);
}

.card-medium.joker-card {
    border-color: var(--gold);
    background: linear-gradient(135deg, #1d1b10 0%, var(--bg-dark) 100%);
}

.card-medium.suit-c .val, .card-medium.suit-c .suit,
.card-medium.suit-s .val, .card-medium.suit-s .suit {
    color: var(--black-suit);
}

.card-medium.suit-h .val, .card-medium.suit-h .suit,
.card-medium.suit-d .val, .card-medium.suit-d .suit {
    color: var(--red-suit);
}

.card-medium .card-center {
    font-size: 1.8rem;
    text-align: center;
    align-self: center;
    margin: auto 0;
}

.card-medium.suit-c .card-center, .card-medium.suit-s .card-center { color: var(--black-suit); }
.card-medium.suit-h .card-center, .card-medium.suit-d .card-center { color: var(--red-suit); }

/* Card Widget (Large) */
.card-large {
    width: 110px;
    height: 165px;
    border-radius: 8px;
    border: 2px solid var(--glass-border);
    background: linear-gradient(135deg, var(--bg-ocean-light) 0%, var(--bg-dark) 100%);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0.5rem;
    position: relative;
    transition: var(--transition-smooth);
}

.card-large:hover {
    transform: translateY(-8px) scale(1.05);
    border-color: var(--gold);
    box-shadow: 0 10px 25px rgba(212, 175, 55, 0.2);
}

.card-large.suit-c, .card-large.suit-s {
    border-color: rgba(226, 232, 240, 0.15);
}
.card-large.suit-c:hover, .card-large.suit-s:hover {
    border-color: var(--black-suit);
    box-shadow: 0 10px 25px var(--black-glow);
}

.card-large.suit-h, .card-large.suit-d {
    border-color: rgba(255, 42, 95, 0.15);
}
.card-large.suit-h:hover, .card-large.suit-d:hover {
    border-color: var(--red-suit);
    box-shadow: 0 10px 25px var(--red-glow);
}

.card-large.joker-card {
    border-color: var(--gold);
    background: linear-gradient(135deg, #1d1b10 0%, var(--bg-dark) 100%);
}

.card-large .card-corner {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.1;
}

.card-large .card-corner .val {
    font-size: 1.2rem;
    font-weight: 900;
}

.card-large .card-corner .suit {
    font-size: 1rem;
}

.card-large.suit-c .val, .card-large.suit-c .suit,
.card-large.suit-s .val, .card-large.suit-s .suit {
    color: var(--black-suit);
}

.card-large.suit-h .val, .card-large.suit-h .suit,
.card-large.suit-d .val, .card-large.suit-d .suit {
    color: var(--red-suit);
}

.card-large .card-center {
    font-size: 2.8rem;
    text-align: center;
    align-self: center;
    margin: auto 0;
}

.card-large.suit-c .card-center, .card-large.suit-s .card-center { color: var(--black-suit); }
.card-large.suit-h .card-center, .card-large.suit-d .card-center { color: var(--red-suit); }

.card-large .card-tech-overlay {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    right: 0.5rem;
    text-align: center;
}

.tech-tag {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--gold);
    color: var(--gold);
    font-size: 0.65rem;
    padding: 0.15rem 0.3rem;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.joker-action {
    display: flex;
    gap: 2px;
}

/* --- Character Sheet layout --- */
.character-sheet-details {
    text-align: left;
}

.sheet-group {
    background: rgba(0,0,0,0.15);
    padding: 1rem;
    border-radius: 8px;
    border-left: 2px solid var(--gold-dark);
}

.sheet-group h4 {
    color: var(--gold);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footnote {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.techniques-list-sheet {
    list-style: none;
}

.techniques-list-sheet li {
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.footnote-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
    margin-left: 1.5rem;
}

.margin-top-small {
    margin-top: 0.5rem;
}

/* --- Between Scenes Upkeep --- */
.between-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

@media (max-width: 800px) {
    .between-grid {
        grid-template-columns: 1fr;
    }
}

.voting-card, .deep-rest-card {
    text-align: left;
}

.voted-confirmation-box {
    padding: 1.5rem;
    text-align: center;
    border: 1px solid var(--neon-emerald);
}

.success-text {
    color: var(--neon-emerald);
    font-weight: 700;
}

.ranks-ledger {
    list-style: none;
}

.ranks-ledger li {
    padding: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: space-between;
}

.deep-badge {
    background: rgba(0, 242, 254, 0.15);
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    padding: 0.1rem 0.4rem;
    font-size: 0.75rem;
    border-radius: 4px;
}

.pirat-badge {
    background: rgba(0, 255, 135, 0.15);
    border: 1px solid var(--neon-emerald);
    color: var(--neon-emerald);
    padding: 0.1rem 0.4rem;
    font-size: 0.75rem;
    border-radius: 4px;
}

/* --- Loader / Spinner widgets --- */
.loader-container {
    padding: 4rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 242, 254, 0.1);
    border-radius: 50%;
    border-top-color: var(--neon-cyan);
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto 1.5rem;
}

.spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    border-top-color: var(--gold);
    animation: spin 1s ease-in-out infinite;
    display: inline-block;
}

/* --- Admin Panel --- */
.admin-players-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.admin-player-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.player-info-basic {
    font-size: 1.05rem;
}

.link-copy-action {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex: 1;
    max-width: 500px;
}

/* --- Alert styles --- */
.alert {
    padding: 0.75rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
}

.alert-danger {
    background: rgba(192, 57, 43, 0.2);
    border: 1px solid #c0392b;
    color: #e74c3c;
}

/* --- Animation keyframes --- */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse-glow {
    0% {
        text-shadow: 0 0 10px var(--neon-cyan), 0 0 20px var(--neon-cyan);
        transform: scale(1);
    }
    50% {
        text-shadow: 0 0 15px var(--neon-cyan), 0 0 30px var(--neon-cyan), 0 0 40px var(--neon-cyan);
        transform: scale(1.05);
    }
    100% {
        text-shadow: 0 0 10px var(--neon-cyan), 0 0 20px var(--neon-cyan);
        transform: scale(1);
    }
}

/* --- Utilities --- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.margin-top { margin-top: 1.5rem; }
.gold-text { color: var(--gold); }
.center-block { margin: 1rem auto; max-width: 500px; }
.inline-form { display: flex; gap: 0.5rem; width: 100%; }
.inline-group { display: flex; gap: 0.5rem; width: 100%; }
.select-small { padding: 0.5rem; font-size: 0.9rem; flex: 1; }
.select-xsmall { padding: 0.4rem; font-size: 0.85rem; }
.btn-small { padding: 0.4rem 0.8rem; font-size: 0.85rem; }

/* --- Visual & Tactile Technique Assignment --- */
.face-tech-drag-form {
    margin-top: 1.5rem;
}

.available-techniques-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--glass-border);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 2rem;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.2);
}

.available-techniques-container h4 {
    font-family: var(--font-heading);
    color: var(--gold);
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.instruction-help {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.techniques-drag-pool {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    min-height: 50px;
    align-items: center;
}

.draggable-tech-chip {
    background: linear-gradient(135deg, rgba(22, 36, 59, 0.9) 0%, rgba(13, 23, 38, 0.9) 100%);
    border: 1px solid var(--gold);
    color: var(--text-primary);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    cursor: grab;
    user-select: none;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3), 0 0 5px rgba(212, 175, 55, 0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.draggable-tech-chip:hover {
    transform: translateY(-2px);
    border-color: var(--neon-cyan);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4), 0 0 10px rgba(0, 242, 254, 0.3);
}

.draggable-tech-chip:active {
    cursor: grabbing;
}

.draggable-tech-chip.dragging {
    opacity: 0.4;
    border-style: dashed;
}

.draggable-tech-chip.selected {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.5);
    background: rgba(0, 242, 254, 0.1);
}

.draggable-tech-chip.assigned-hidden {
    opacity: 0.2;
    pointer-events: none;
    cursor: not-allowed;
    border-color: var(--text-muted);
}

.drag-icon {
    color: var(--gold);
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Slots Grid */
.face-cards-slots-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .face-cards-slots-grid {
        grid-template-columns: 1fr;
    }
}

.face-card-slot-wrapper {
    display: flex;
    justify-content: center;
}

.face-card-slot {
    position: relative;
    width: 100%;
    max-width: 220px;
    aspect-ratio: 2 / 3;
    min-height: 280px;
    background: linear-gradient(135deg, rgba(13, 23, 38, 0.8) 0%, rgba(7, 11, 18, 0.9) 100%);
    border: 2px dashed rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition-smooth);
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.face-card-slot:hover {
    border-color: rgba(212, 175, 55, 0.7);
    box-shadow: 0 12px 30px rgba(212, 175, 55, 0.15);
    transform: translateY(-4px);
}

.face-card-slot.drag-over {
    border-color: var(--neon-cyan);
    border-style: solid;
    background: rgba(0, 242, 254, 0.05);
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.2);
    transform: scale(1.02);
}

.face-card-slot.has-assignment {
    border-style: solid;
    border-color: var(--gold);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(212, 175, 55, 0.15);
}

.card-bg-letter {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-heading);
    font-size: 8rem;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.025);
    line-height: 1;
    pointer-events: none;
    user-select: none;
    transition: var(--transition-smooth);
}

.face-card-slot.has-assignment .card-bg-letter {
    color: rgba(212, 175, 55, 0.04);
}

.card-slot-header, .card-slot-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-muted);
    pointer-events: none;
    user-select: none;
}

.face-card-slot.has-assignment .card-slot-header,
.face-card-slot.has-assignment .card-slot-footer {
    color: var(--gold);
}

.card-slot-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 2;
    padding: 0.5rem 0;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    pointer-events: none;
}

.face-card-slot.has-assignment .card-title {
    color: var(--gold);
}

.drop-zone-placeholder {
    font-size: 0.8rem;
    color: var(--text-muted);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    transition: var(--transition-smooth);
    pointer-events: none;
}

.face-card-slot:hover .drop-zone-placeholder {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

.assigned-tech-content {
    width: 100%;
    display: none;
}

.face-card-slot.has-assignment .drop-zone-placeholder {
    display: none;
}

.face-card-slot.has-assignment .assigned-tech-content {
    display: block;
}

.assigned-tech-chip {
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid var(--gold);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 8px;
    font-size: 0.85rem;
    position: relative;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    word-break: break-word;
    animation: fadeIn 0.3s ease;
}

.remove-tech-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #c0392b;
    border: 1px solid #e74c3c;
    color: white;
    font-size: 10px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    transition: var(--transition-smooth);
}

.remove-tech-btn:hover {
    background: #e74c3c;
    transform: scale(1.1);
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Drag and Drop Interface Styles */
.card-large[draggable="true"] {
    cursor: grab;
}

.card-large[draggable="true"]:active {
    cursor: grabbing;
}

.card-large.dragging {
    opacity: 0.4;
    border-style: dashed;
    transform: scale(0.95);
}

.obstacle-item.drag-over {
    border-color: var(--gold) !important;
    background: rgba(212, 175, 55, 0.1) !important;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.2) !important;
    transform: translateY(-2px) scale(1.01);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Deep Upkeep Hand Refresh Drag & Drop --- */
.upkeep-drag-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

@media (max-width: 768px) {
    .upkeep-drag-container {
        grid-template-columns: 1fr;
    }
}

.upkeep-box {
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.upkeep-box h3 {
    margin-bottom: 1rem;
    font-family: var(--font-heading);
}

.upkeep-flex {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px dashed var(--glass-border);
    border-radius: 8px;
    align-content: flex-start;
    min-height: 300px;
    transition: var(--transition-smooth);
}

.upkeep-box[ondragover]:hover .upkeep-flex {
    border-color: var(--neon-cyan);
}

