* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1a 100%);
    color: #fff;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
}

#app {
    max-width: 600px;
    margin: 0 auto;
}

h2 {
    text-align: center;
    color: #fff;
    font-weight: 300;
    font-size: 13px;
    letter-spacing: 6px;
    text-transform: uppercase;
    margin-bottom: 28px;
    opacity: 0.7;
}

.mode {
    background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0) 100%);
    border: 1px solid rgba(255,255,255,0.1);
    border-top: 1px solid rgba(255,255,255,0.2);
    padding: 28px;
}

.hidden {
    display: none !important;
}

/* Settings */
.settings {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 28px;
}

.setting {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting label {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    font-weight: 500;
}

.setting select {
    padding: 10px 14px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(0,0,0,0.3);
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.2s;
}

.setting select:hover {
    border-color: rgba(255,255,255,0.4);
}

.setting input[type="checkbox"] {
    margin-right: 8px;
    accent-color: #ff2d75;
}

/* Color Palette */
.color-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 28px;
    padding: 20px;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.08);
}

.color-option {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid rgba(0,0,0,0.5);
    transition: transform 0.15s, box-shadow 0.15s;
    position: relative;
    box-shadow:
        0 4px 8px rgba(0,0,0,0.4),
        inset 0 2px 4px rgba(255,255,255,0.25),
        inset 0 -2px 4px rgba(0,0,0,0.25);
}

.color-option:hover {
    transform: scale(1.15) translateY(-2px);
    z-index: 10;
}

.color-option.selected {
    border-color: #fff;
    transform: scale(1.1);
    box-shadow:
        0 0 0 3px rgba(255,255,255,0.3),
        0 0 25px currentColor,
        0 4px 12px rgba(0,0,0,0.5),
        inset 0 2px 4px rgba(255,255,255,0.25);
}

.color-option.dotted::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    background: radial-gradient(circle, #fff 0%, rgba(255,255,255,0.8) 50%, transparent 70%);
    border-radius: 50%;
}

.color-option.blank {
    background: radial-gradient(circle at 30% 30%, #3a3a3a 0%, #1a1a1a 100%) !important;
    border: 3px dashed rgba(255,255,255,0.2);
    box-shadow:
        0 4px 8px rgba(0,0,0,0.4),
        inset 0 2px 4px rgba(255,255,255,0.1);
}

.color-option.blank::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 3px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
}

/* Creator Actions */
.creator-actions {
    display: flex;
    gap: 12px;
}

.creator-actions .secondary-btn {
    flex-shrink: 0;
}

.creator-actions .primary-btn {
    flex: 1;
}

/* Code Row */
.code-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 28px;
}

.peg-slot {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #2a2a3a 0%, #151520 100%);
    border: 3px dashed rgba(255,255,255,0.15);
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
    position: relative;
    box-shadow:
        inset 0 4px 12px rgba(0,0,0,0.5),
        0 2px 4px rgba(0,0,0,0.3);
}

.peg-slot:hover {
    border-color: rgba(255,255,255,0.35);
    transform: scale(1.05);
}

.peg-slot.filled {
    border-style: solid;
    border-color: rgba(0,0,0,0.5);
    box-shadow:
        0 6px 16px rgba(0,0,0,0.5),
        0 0 20px rgba(255,255,255,0.1),
        inset 0 3px 6px rgba(255,255,255,0.3),
        inset 0 -3px 6px rgba(0,0,0,0.3);
}

.peg-slot.filled.dotted::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: radial-gradient(circle, #fff 0%, rgba(255,255,255,0.8) 50%, transparent 70%);
    border-radius: 50%;
}

.peg-slot.blank-filled {
    background: radial-gradient(circle at 30% 30%, #2a2a2a 0%, #151515 100%) !important;
    border: 3px solid rgba(255,255,255,0.1);
}

.peg-slot.blank-filled::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 3px;
    background: rgba(255,255,255,0.25);
    border-radius: 2px;
}

/* Buttons */
.primary-btn {
    display: block;
    width: 100%;
    padding: 16px 28px;
    background: linear-gradient(135deg, #ff2d75 0%, #ff0055 100%);
    color: #fff;
    border: none;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 20px rgba(255, 45, 117, 0.4);
}

.primary-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #ff4d8d 0%, #ff2266 100%);
    box-shadow: 0 6px 30px rgba(255, 45, 117, 0.6);
    transform: translateY(-2px);
}

.primary-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    box-shadow: none;
}

.secondary-btn {
    padding: 12px 24px;
    background: transparent;
    color: rgba(255,255,255,0.6);
    border: 1px solid rgba(255,255,255,0.2);
    font-size: 12px;
    font-family: inherit;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-btn:hover {
    border-color: rgba(255,255,255,0.5);
    color: #fff;
    background: rgba(255,255,255,0.05);
}

/* Game Info */
.game-info {
    text-align: center;
    margin-top: 24px;
    padding: 14px;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    font-weight: 500;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.game-info #share-progress {
    margin: 0;
    flex-shrink: 0;
}

/* New game link */
.new-game-link {
    display: block;
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    color: rgba(255,255,255,0.3);
    text-decoration: none;
    transition: color 0.2s;
}

.new-game-link:hover {
    color: rgba(255,255,255,0.6);
}

/* Stopwatch */
#stopwatch {
    text-align: center;
    font-size: 32px;
    font-weight: 300;
    color: rgba(255,255,255,0.4);
    margin-bottom: 24px;
    letter-spacing: 2px;
    font-variant-numeric: tabular-nums;
}

#stopwatch.final-time {
    color: #4ade80;
}

/* Guess History */
#guess-history {
    margin-bottom: 28px;
}

.guess-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 14px;
    margin-bottom: 6px;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.05);
    border-left: 3px solid rgba(255,255,255,0.1);
}

.guess-pegs {
    display: flex;
    gap: 8px;
}

.guess-peg {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid rgba(0,0,0,0.4);
    position: relative;
    box-shadow:
        0 3px 8px rgba(0,0,0,0.4),
        inset 0 2px 4px rgba(255,255,255,0.2),
        inset 0 -2px 4px rgba(0,0,0,0.2);
}

.guess-peg.dotted::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, #fff 0%, rgba(255,255,255,0.7) 60%, transparent 70%);
    border-radius: 50%;
}

.guess-peg.blank-peg {
    background: radial-gradient(circle at 30% 30%, #2a2a2a 0%, #151515 100%) !important;
    border: 2px dashed rgba(255,255,255,0.15);
    box-shadow:
        0 3px 8px rgba(0,0,0,0.3),
        inset 0 2px 4px rgba(255,255,255,0.05);
}

.guess-peg.blank-peg::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 2px;
    background: rgba(255,255,255,0.2);
    border-radius: 1px;
}

.guess-feedback {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    width: 65px;
}

.feedback-peg {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.feedback-peg.correct {
    background: radial-gradient(circle at 30% 30%, #4ade80 0%, #22c55e 100%);
    box-shadow: 0 0 12px rgba(74, 222, 128, 0.6), 0 2px 4px rgba(0,0,0,0.3);
}

.feedback-peg.misplaced {
    background: radial-gradient(circle at 30% 30%, #fde047 0%, #eab308 100%);
    box-shadow: 0 0 12px rgba(253, 224, 71, 0.5), 0 2px 4px rgba(0,0,0,0.3);
}

.feedback-peg.wrong {
    background: radial-gradient(circle at 30% 30%, #333 0%, #1a1a1a 100%);
    border: 1px solid rgba(255,255,255,0.1);
}

.guess-number {
    font-size: 12px;
    color: rgba(255,255,255,0.25);
    width: 24px;
    text-align: center;
    font-weight: 600;
}

/* Current Guess */
.current-guess-container {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
}

.current-guess-container .code-row {
    margin-bottom: 0;
    flex-basis: 100%;
}

/* Game Result */
#game-result {
    text-align: center;
    padding: 24px;
    margin-bottom: 24px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
}

#game-result.win {
    background: rgba(74, 222, 128, 0.1);
    color: #4ade80;
    border: 2px solid #4ade80;
    box-shadow: 0 0 40px rgba(74, 222, 128, 0.2), inset 0 0 40px rgba(74, 222, 128, 0.05);
}

#game-result.revealed {
    background: rgba(255,255,255,0.03);
    color: rgba(255,255,255,0.5);
    border: 1px solid rgba(255,255,255,0.15);
}


/* Responsive */
@media (max-width: 480px) {
    .settings {
        grid-template-columns: 1fr;
    }

    .peg-slot {
        width: 46px;
        height: 46px;
    }

    .color-option {
        width: 36px;
        height: 36px;
    }

    .guess-peg {
        width: 30px;
        height: 30px;
    }
}
