body {
    font-family: 'Arial', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    color: #333;
    overflow-x: hidden;
}

h1 {
    color: white;
    font-size: 2.5em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

#timer {
    font-size: 1.5em;
    font-weight: bold;
    color: white;
    background: rgba(0,0,0,0.3);
    padding: 10px 20px;
    border-radius: 25px;
    margin-bottom: 20px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    display: inline-block;
}

.game-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    justify-content: center;
    max-width: 1200px;
    width: min(100%, 1200px);
    margin: 0 auto;
}

.game-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.records-section {
    min-width: 300px;
}

#message {
    font-size: 18px;
    font-weight: bold;
    margin: 15px 0;
    padding: 10px;
    border-radius: 5px;
    background-color: rgba(255,255,255,0.9);
    min-height: 20px;
}

#message:empty {
    display: none;
}

#game-board {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    border: 3px solid #333;
    padding: 20px;
    background: linear-gradient(145deg, #e6e6e6, #ffffff);
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    max-width: 800px;
    width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.row {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: linear-gradient(145deg, #f8f8f8, #e8e8e8);
    border-radius: 10px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    margin-bottom: 5px;
    position: relative;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.row.active-row {
    background-color: #e8f5e8;
    border-color: #4CAF50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

.row-number {
    width: 30px;
    height: 30px;
    background-color: #666;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

.mini-palette {
    display: flex;
    gap: 3px;
    flex-shrink: 0;
}

.mini-color-option {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.mini-color-option:hover {
    transform: scale(1.1);
}

.mini-color-option.selected {
    border-color: #000;
    transform: scale(1.2);
}

.pegs-container {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.mini-buttons {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex-shrink: 0;
}

.mini-check-btn, .mini-clear-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.mini-check-btn {
    background-color: #4CAF50;
    color: white;
}

.mini-check-btn:hover {
    background-color: #45a049;
    transform: scale(1.1);
}

.mini-clear-btn {
    background-color: #ff6b6b;
    color: white;
}

.mini-clear-btn:hover {
    background-color: #ff5252;
    transform: scale(1.1);
}

.row-message {
    position: absolute;
    right: 10px;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.row-message.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.peg {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid #333;
    cursor: pointer;
    background-color: #fff;
    transition: all 0.3s ease;
}

.peg:hover {
    border-color: #666;
    transform: scale(1.05);
}

#color-palette {
    display: flex;
    margin-bottom: 20px;
}

.color-option {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    margin: 0 8px;
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: #000;
    transform: scale(1.15);
}

#restart-button {
    padding: 15px 30px;
    font-size: 18px;
    cursor: pointer;
    margin: 20px 5px;
    border: none;
    border-radius: 8px;
    background-color: #2196F3;
    color: white;
    transition: all 0.3s ease;
    font-weight: bold;
}

#restart-button:hover {
    background-color: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.hint-container {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background-color: #e0e0e0;
    border-radius: 5px;
    padding: 5px;
}

.hint-peg {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid #333;
}

.black-peg {
    background-color: #333;
}

.white-peg {
    background-color: #fff;
}

#secret-code {
    display: flex;
    margin-top: 20px;
}

#secret-code .peg {
    cursor: default;
}

.hidden {
    display: none;
}

/* Records Styles */
#records {
    background: rgba(255,255,255,0.95);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    min-height: 400px;
}

#records h3 {
    margin: 0 0 20px 0;
    color: #333;
    text-align: center;
    font-size: 1.3em;
}

.records-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.record-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: linear-gradient(145deg, #f8f8f8, #e8e8e8);
    border-radius: 10px;
    border-left: 4px solid #ddd;
    position: relative;
}

.record-item.top-1 {
    border-left-color: #ffd700;
    background: linear-gradient(145deg, #fff9e6, #fff3cd);
}

.record-item.top-2 {
    border-left-color: #c0c0c0;
    background: linear-gradient(145deg, #f5f5f5, #e9e9e9);
}

.record-item.top-3 {
    border-left-color: #cd7f32;
    background: linear-gradient(145deg, #fdf2e9, #fcebdae8);
}

.record-position {
    font-weight: bold;
    font-size: 1.2em;
    color: #666;
    min-width: 25px;
    text-align: center;
}

.record-info {
    flex: 1;
}

.record-name {
    font-weight: bold;
    color: #333;
    font-size: 1em;
}

.record-details {
    font-size: 0.9em;
    color: #666;
    margin-top: 2px;
}

.record-crown {
    font-size: 1.5em;
}

.no-records {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 20px;
}

.clear-records-btn {
    width: 100%;
    padding: 10px;
    margin-top: 20px;
    background-color: #ff6b6b;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.3s ease;
}

.clear-records-btn:hover {
    background-color: #ff5252;
}

/* Responsive Design */
@media (max-width: 1100px) {
    .game-container {
        flex-direction: column;
        align-items: center;
        max-width: 800px;
    }
    
    .records-section {
        width: 100%;
        max-width: 400px;
    }
}

@media (max-width: 600px) {
    body { padding: 10px; }
    h1 { font-size: 1.8em; margin-bottom: 12px; }
    .game-container { gap: 16px; }
    #game-board { width: 100%; padding: 8px; gap: 4px; }
    .row { gap: 5px; padding: 6px 4px; margin-bottom: 2px; }
    .row-number { width: 22px; height: 22px; font-size: 11px; }
    .mini-color-option { width: 20px; height: 20px; }
    .pegs-container { gap: 3px; }
    .peg { width: 30px; height: 30px; }
    .mini-buttons { gap: 2px; }
    .mini-check-btn, .mini-clear-btn { width: 24px; height: 24px; font-size: 11px; }
    .hint-container { width: 28px; height: 28px; padding: 3px; }
    .hint-peg { width: 8px; height: 8px; }
    #color-palette { flex-wrap: wrap; justify-content: center; }
    .color-option { width: 38px; height: 38px; margin: 0 4px; }
    #records { width: 100%; min-height: 0; padding: 12px; box-sizing: border-box; }
}
