:root {
    --bg-gradient: linear-gradient(135deg, #050a2e 0%, #0b3842 33%, #0c4a3b 66%, #2a0038 100%);
    --primary-color: #00e5ff;
    --primary-hover: #00b8d4;
    --secondary-color: #a855f7;
    --secondary-hover: #9333ea;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    --text-main: #ffffff;
    --text-light: #c2e0ff;
    --card-bg: rgba(8, 14, 33, 0.75);
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    --neon-glow: 0 0 20px rgba(0, 229, 255, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-main);
}

.container {
    width: 100%;
    max-width: 480px;
    background: var(--card-bg);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--card-shadow), var(--neon-glow);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(168, 85, 247, 0.3);
    min-height: 500px;
    position: relative;
    overflow: hidden;
    margin: 20px;
}

.screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    animation: fadeIn 0.4s ease-out;
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.game-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--primary-color);
    text-align: center;
}

.flavor-text {
    font-size: 0.95rem;
    color: var(--primary-color);
    letter-spacing: 3px;
    margin-top: -5px;
    margin-bottom: 5px;
    text-align: center;
    font-weight: bold;
    opacity: 0.9;
}

.subtitle {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 40px;
    text-align: center;
}

.screen-heading {
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: var(--text-main);
    text-align: center;
}

.input-group {
    width: 100%;
    margin-bottom: 25px;
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 8px;
    color: var(--text-light);
}

.input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #1c3359;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
    background: rgba(0, 0, 0, 0.4);
    color: var(--text-main);
}

.input-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.2);
}

.btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 229, 255, 0.3);
}

.primary-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 229, 255, 0.5);
}

.primary-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.secondary-btn {
    background-color: var(--secondary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(108, 125, 211, 0.3);
}

.secondary-btn:hover {
    background-color: var(--secondary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 125, 211, 0.4);
}

.danger-btn {
    background-color: var(--danger-color);
    color: white;
}

.danger-btn:hover {
    background-color: var(--danger-hover);
}

.text-btn {
    background: transparent;
    color: var(--text-light);
    box-shadow: none;
    text-decoration: underline;
}

.text-btn:hover {
    color: var(--text-main);
}

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }

/* Menu */
.menu-buttons {
    width: 100%;
}

/* Lobby */
.room-info-card {
    background: rgba(0, 0, 0, 0.4);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
    border: 1px solid #3d2f60;
    font-weight: bold;
    font-size: 1.1rem;
}

.selectable {
    user-select: text;
    letter-spacing: 2px;
    color: var(--primary-color);
}

.players-container {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 25px;
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #3d2f60;
}

.players-container h3 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: var(--text-light);
    border-bottom: 1px solid #3d2f60;
    padding-bottom: 8px;
}

#players-list {
    list-style: none;
}

.player-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border: 1px solid #3d2f60;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.player-icon {
    font-size: 1.2rem;
    margin-right: 10px;
}

.player-name {
    font-weight: bold;
    flex-grow: 1;
}

.host-badge {
    background: #ffd700;
    color: #b8860b;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
}

.lobby-actions {
    width: 100%;
}

.game-logo {
    width: calc(100% + 50px);
    margin-left: -25px;
    margin-right: -25px;
    margin-top: -15px;
    max-width: none;
    height: auto;
    margin-bottom: 25px;
    border-radius: 16px;
    box-shadow: var(--neon-glow);
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0px); }
}

/* Game Screen Elements */
.card-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin: 30px 0;
}

.game-card {
    background-color: #ffffff;
    color: #160631; /* Deep dark purple to connect with the theme */
    width: 65px;
    height: 90px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    user-select: none;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.6), 0 0 15px rgba(255,255,255,0.4);
}

.alphabet-card {
    font-size: 2.5rem;
}

.sense-card {
    font-size: 1.1rem;
    text-align: center;
}

.topic-display {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--primary-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
    text-align: center;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.2);
    width: 100%;
    transition: transform 0.2s ease-out;
}

.topic-player {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 10px;
}

.topic-cards-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
}

.topic-item-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 10px;
    width: 130px;
    height: 130px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    color: #160631;
    overflow: hidden;
}

.card-hint {
    font-size: 0.8rem;
    color: #888;
    letter-spacing: 1px;
    margin-bottom: 5px;
    flex-shrink: 0;
}

.card-main {
    font-size: 2.2rem;
    font-weight: bold;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    width: 100%;
}

.topic-connector {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-main);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.answer-section {
    margin-top: 30px;
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(0, 229, 255, 0.3);
}

.answer-input {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    border: 2px solid #1c3359;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.4);
    color: white;
    outline: none;
    text-align: center;
    transition: all 0.3s;
}

.answer-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.3);
}

.answer-input:disabled {
    background: rgba(255, 255, 255, 0.05);
    color: #e0e6ed;
    border-color: #1c3359;
}

.answer-actions {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    justify-content: center;
}

.answer-actions .btn {
    flex: 1;
    margin-bottom: 0;
}

.dealer-info {
    font-size: 1.2rem;
    color: var(--secondary-color);
    font-weight: bold;
    margin-bottom: 15px;
    padding: 5px 10px;
    border: 1px solid var(--secondary-color);
    border-radius: 5px;
    display: inline-block;
    background: rgba(236, 72, 153, 0.1);
}

.confirm-status-text {
    margin-top: 15px;
    font-size: 0.9rem;
    color: #aaa;
    text-align: center;
}

.results-section {
    margin-top: 30px;
}

.dealer-result {
    margin-bottom: 20px;
}

.answer-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-main);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
    
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 80px;
    gap: 5px;
    
    word-break: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.dealer-card {
    border-color: var(--secondary-color);
    box-shadow: 0 0 15px rgba(236, 72, 153, 0.3);
    font-size: 1.8rem;
}

.others-answers-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.countdown-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    border-radius: 12px;
}

.countdown-text {
    font-size: 8rem;
    font-weight: bold;
    color: var(--primary-color);
    text-shadow: 0 0 30px rgba(0, 229, 255, 1);
    animation: countdownPulse 1s ease-in-out infinite;
}

@keyframes countdownPulse {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 0; }
}

.selected-card {
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    background: rgba(255, 215, 0, 0.1);
    transform: scale(1.05);
    transition: all 0.2s;
}
