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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #FF6B6B 0%, #FFE66D 100%);
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile */
    overflow: hidden;
    color: #333;
    display: flex;
    flex-direction: column;
}

/* Container */
.container {
    width: 100%;
    height: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 12px;
    padding-bottom: env(safe-area-inset-bottom, 12px);
    display: flex;
    flex-direction: column;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 12px;
    flex-shrink: 0;
}

h1 {
    color: white;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 6px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

h2 {
    color: white;
    font-size: 16px;
    font-weight: 400;
    opacity: 0.95;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

/* Game Info Pills */
.game-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    margin-top: 8px;
}

.game-info span {
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 16px;
}

/* Main Content Card */
.game-content {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* Sections */
.section {
    margin-bottom: 24px;
}

.section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 13px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    margin-bottom: 6px;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #f0f0f0;
    border-radius: 10px;
    font-size: 15px;
    transition: border-color 0.2s ease;
    background: white;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: #FF6B6B;
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

/* Buttons */
.btn {
    padding: 14px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
    color: white;
}

.btn-primary:hover {
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: #f8f8f8;
    color: #888;
    border: 2px solid #f0f0f0;
}

.btn-secondary:hover {
    background: #f0f0f0;
}

.btn-secondary:active {
    transform: scale(0.98);
}

.btn-success {
    background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%);
    color: white;
}

.btn-success:hover {
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

/* Actions Container */
.actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    margin-top: auto;
}

.actions .btn {
    flex: 1;
}

/* Lists */
.player-list,
.item-list {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    margin-bottom: 16px;
}

.player-item,
.list-item {
    padding: 12px 16px;
    background: #f8f8f8;
    border-radius: 10px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.player-item:last-child,
.list-item:last-child {
    margin-bottom: 0;
}

.player-name {
    font-weight: 500;
    color: #333;
}

.player-status {
    font-size: 12px;
    color: #999;
}

.status-ready {
    color: #4CAF50;
}

.status-waiting {
    color: #FF9800;
}

/* Status Messages */
.status-message {
    text-align: center;
    padding: 16px;
    background: #FFF3E0;
    border-radius: 10px;
    color: #F57C00;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
}

/* Instructions */
.instructions {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.instructions strong {
    color: #FF6B6B;
    font-weight: 600;
}

/* Game Code Display */
.game-code-display {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
    border-radius: 12px;
    color: white;
    margin-bottom: 20px;
}

.game-code-label {
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 4px;
}

.game-code {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 4px;
}

/* Score Table */
.score-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.score-table th {
    background: #f8f8f8;
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    color: #666;
    border-bottom: 2px solid #e0e0e0;
}

.score-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #f0f0f0;
}

.score-table tr.current-player {
    background: #FFF8E1;
}

.score-table .player-name-cell {
    font-weight: 500;
}

.score-table .score-cell {
    text-align: center;
    font-weight: 600;
}

.score-table .total-cell {
    font-weight: 700;
    color: #FF6B6B;
}

.comparison-column {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.comparison-header {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
    text-align: center;
    padding: 8px;
    background: #f8f8f8;
    border-radius: 8px;
}

.comparison-list {
    flex: 1;
    overflow-y: auto;
    background: #fafafa;
    border-radius: 8px;
    padding: 8px;
}

.comparison-item {
    padding: 8px 10px;
    background: white;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.comparison-item:last-child {
    margin-bottom: 0;
}

.comparison-item-number {
    width: 20px;
    height: 20px;
    background: #FF6B6B;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    margin-right: 10px;
    flex-shrink: 0;
}

/* Winner Display */
.winner-display {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #4CAF50 0%, #66BB6A 100%);
    border-radius: 12px;
    color: white;
    margin-bottom: 20px;
}

.winner-display h3 {
    font-size: 20px;
    margin-bottom: 4px;
}

.winner-display .winner-name {
    font-size: 24px;
    font-weight: 700;
}

.game-winner {
    background: linear-gradient(135deg, #FFD700 0%, #FFC107 100%);
}

/* Scrollable Container */
.scrollable-content {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Hamburger Menu */
.hamburger-menu {
    position: fixed;
    top: 8px;
    right: 8px;
    z-index: 1000;
}

.menu-toggle {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    transition: background-color 0.3s ease;
}

.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.menu-toggle span {
    width: 20px;
    height: 2px;
    background: white;
    border-radius: 1px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(3px, 3px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(3px, -3px);
}

.menu-dropdown {
    position: absolute;
    top: 52px;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    overflow: hidden;
}

.menu-toggle.active + .menu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.menu-item {
    border-bottom: 1px solid #f0f0f0;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item a {
    display: block;
    padding: 14px 18px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.menu-item a:hover {
    background: #f8f8f8;
    color: #FF6B6B;
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: transparent;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Responsive Design */
@media (max-height: 600px) {
    .container { padding: 8px; }
    h1 { font-size: 24px; margin-bottom: 4px; }
    h2 { font-size: 14px; }
    .game-info { font-size: 12px; }
    .game-content { padding: 16px; }
    .instructions { font-size: 13px; margin-bottom: 12px; }
    .btn { padding: 12px; font-size: 13px; }
    .section { margin-bottom: 16px; }
    .game-code { font-size: 28px; }
}

@media (max-height: 500px) {
    .game-content { padding: 12px; }
    .player-item, .list-item { padding: 10px 12px; }
    .actions { gap: 8px; }
    .btn { padding: 10px; }
    .section { margin-bottom: 12px; }
}
