/* LockCode - Specific styles */

/* Add minimal padding for share button */
.panel.card {
    padding-bottom: 24px;
}

/* Logo styles */
.lockcode-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    margin-bottom: 4px;
}

.logo-icon {
    font-size: 48px;
    filter: drop-shadow(0 4px 12px rgba(56, 232, 255, 0.4));
}

.logo-text {
    font-size: 42px;
    font-weight: 900;
    letter-spacing: 2px;
    color: var(--primary);
    text-shadow: 0 4px 12px rgba(56, 232, 255, 0.3);
}

.nav-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-link {
    text-decoration: none;
}

/* Subtitle */
.subtitle {
    color: var(--muted);
    margin: 0 0 8px;
    font-weight: 500;
    font-size: 16px;
}

/* Attempts display */
.attempts-display {
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    margin-bottom: 12px;
    background: rgba(56, 232, 255, 0.08);
    border-radius: 12px;
    border: 1px solid rgba(56, 232, 255, 0.2);
}

.attempts-display.visible {
    display: flex;
}

.attempts-count {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

.attempts-label {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

/* Clues section */
.clues-section {
    display: none;
    flex-direction: column;
    gap: 12px;
    margin: 16px 0;
    padding: 0;
    background: rgba(15, 23, 56, 0.95);
    border-radius: 14px;
    border: 1px solid var(--border);
    overflow: hidden;
    position: relative;
    z-index: 10;
}

.clues-section.visible {
    display: flex;
}

.clues-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    background: transparent;
    border: none;
    padding: 16px;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s ease;
}

.clues-header:hover {
    background: rgba(56, 232, 255, 0.05);
}

.clues-header:active {
    background: rgba(56, 232, 255, 0.1);
}

.clues-icon {
    font-size: 20px;
}

.clues-title {
    flex: 1;
}

.clues-toggle-icon {
    font-size: 12px;
    color: var(--muted);
    transition: transform 0.3s ease;
}

.clues-section.collapsed .clues-toggle-icon {
    transform: rotate(-90deg);
}

.clues-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 16px 16px;
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.clues-section.collapsed .clues-list {
    max-height: 0;
    padding: 0 16px;
}

.clue-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(56, 232, 255, 0.15);
}

.clue-code {
    display: flex;
    gap: 4px;
}

.clue-digit {
    width: 32px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.3);
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.clue-arrow {
    font-size: 16px;
    color: var(--muted);
}

.clue-feedback {
    flex: 1;
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
    line-height: 1.4;
}

.feedback-right {
    color: var(--success);
}

.feedback-wrong {
    color: var(--warning);
}

.feedback-none {
    color: var(--muted);
}

/* Guess history */
.guess-history {
    display: none;
    flex-direction: column;
    gap: 12px;
    margin: 16px 0;
    padding: 0;
    background: rgba(15, 23, 56, 0.95);
    border-radius: 14px;
    border: 1px solid var(--border);
    position: relative;
    z-index: 5;
    max-height: 400px;
    overflow: hidden;
}

.guess-history.visible {
    display: flex;
}

.history-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: var(--secondary);
    background: transparent;
    border: none;
    padding: 16px;
    cursor: pointer;
    width: 100%;
    transition: background 0.2s ease;
    position: relative;
    z-index: 10;
}

.history-header:hover {
    background: rgba(198, 92, 255, 0.05);
}

.history-header:active {
    background: rgba(198, 92, 255, 0.1);
}

.history-icon {
    font-size: 20px;
}

.history-title {
    flex: 1;
}

.history-toggle-icon {
    font-size: 12px;
    color: var(--muted);
    transition: transform 0.3s ease;
}

.guess-history.collapsed .history-toggle-icon {
    transform: rotate(-90deg);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 16px 16px;
    max-height: 350px;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.guess-history.collapsed .history-list {
    max-height: 0;
    padding: 0 16px;
}

/* Custom scrollbar for guess history */
.history-list::-webkit-scrollbar {
    width: 6px;
}

.history-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.history-list::-webkit-scrollbar-thumb {
    background: rgba(198, 92, 255, 0.4);
    border-radius: 3px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: rgba(198, 92, 255, 0.6);
}

.history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    border: 1px solid rgba(198, 92, 255, 0.15);
    animation: slideUp 0.3s ease-out;
}

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

.history-number {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    background: var(--secondary);
    color: #050714;
    border-radius: 50%;
    flex-shrink: 0;
}

.history-guess {
    display: flex;
    gap: 4px;
}

.history-digit {
    width: 28px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    border-radius: 6px;
    background: rgba(198, 92, 255, 0.2);
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.history-feedback {
    display: flex;
    gap: 8px;
    margin-left: auto;
    font-size: 13px;
    font-weight: 600;
}

.feedback-pill {
    padding: 4px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.feedback-pill.right {
    background: rgba(92, 255, 177, 0.15);
    color: var(--success);
}

.feedback-pill.wrong {
    background: rgba(255, 200, 87, 0.15);
    color: var(--warning);
}

/* Digit input */
.input-section {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(5, 7, 20, 0.98) 85%, transparent);
    padding: 16px 20px 20px;
    margin: 0 -20px;
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.digit-input-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 16px;
}

.digit-input-container.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

.digit-box {
    width: 54px;
    height: 66px;
    border-radius: 14px;
    background: radial-gradient(circle at 25% 20%, rgba(56, 232, 255, 0.18), transparent 55%),
                radial-gradient(circle at 80% 80%, rgba(198, 92, 255, 0.16), transparent 55%),
                #101730;
    border: 2px solid rgba(56, 232, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    transition: all 0.2s ease;
    cursor: pointer;
}

.digit-box.active {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(56, 232, 255, 0.35);
}

.digit-box.filled {
    background: linear-gradient(145deg, rgba(56, 232, 255, 0.25), rgba(198, 92, 255, 0.2));
    border-color: var(--primary);
}

.digit-box.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Numeric keypad */
.keyboard-dock {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 8px;
}

.keyboard-dock .btn-row {
    width: 100%;
    max-width: 400px;
}

.keyboard-dock .btn-row .btn {
    padding: 10px 16px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.keypad {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    margin-top: 8px;
    width: 100%;
    max-width: 360px;
}

.keypad-row {
    display: flex;
    gap: 6px;
    justify-content: center;
    width: 100%;
}

.keypad-row.keypad-actions {
    gap: 8px;
    margin-top: 2px;
}

.keypad-key {
    width: 60px;
    height: 44px;
    border-radius: 10px;
    background: #0f1833;
    border: 1px solid rgba(56, 232, 255, 0.25);
    color: var(--text);
    font-weight: 700;
    font-size: 18px;
    cursor: pointer;
    user-select: none;
    text-align: center;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.35);
    transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease;
    font-variant-numeric: tabular-nums;
}

.keypad-row.keypad-actions .keypad-key {
    flex: 1;
    max-width: 120px;
}

.keypad-key:active:not(:disabled) {
    transform: translateY(2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.keypad-key:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.keypad-action {
    font-size: 18px;
    background: rgba(56, 232, 255, 0.1);
    border-color: rgba(56, 232, 255, 0.4);
}

/* Win/Lose containers */
.win-container,
.lose-container {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px;
    margin: 16px 0;
    border-radius: 16px;
}

.win-container.visible,
.lose-container.visible {
    display: flex;
}

.win-container {
    background: linear-gradient(135deg, rgba(92, 255, 177, 0.15), rgba(56, 232, 255, 0.1));
    border: 2px solid var(--success);
}

.lose-container {
    background: linear-gradient(135deg, rgba(255, 77, 106, 0.15), rgba(198, 92, 255, 0.1));
    border: 2px solid var(--danger);
}

.win-icon,
.lose-icon {
    font-size: 56px;
    margin-bottom: 12px;
}

.win-message,
.lose-message {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.win-message {
    color: var(--success);
}

.lose-message {
    color: var(--danger);
}

.win-code,
.lose-code {
    font-size: 18px;
    color: var(--text);
    margin-bottom: 8px;
}

.win-code {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: 8px;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
}

.lose-code span {
    font-weight: 800;
    color: var(--warning);
    font-variant-numeric: tabular-nums;
    letter-spacing: 4px;
}

.win-stats {
    font-size: 14px;
    color: var(--muted);
}

/* Responsive */
@media (max-width: 480px) {
    .panel.card {
        padding-bottom: 24px;
    }
    
    .logo-icon {
        font-size: 36px;
    }
    
    .logo-text {
        font-size: 32px;
    }
    
    .digit-box {
        width: 48px;
        height: 58px;
        font-size: 24px;
    }
    
    .input-section {
        margin: 0 -16px;
        padding: 12px 16px 16px;
    }
    
    .keyboard-dock .btn-row {
        max-width: 220px;
    }
    
    .keyboard-dock .btn-row .btn {
        padding: 8px 12px;
        height: 40px;
        font-size: 15px;
    }
    
    .keypad {
        gap: 5px;
        max-width: 320px;
    }
    
    .keypad-row {
        gap: 5px;
    }
    
    .keypad-row.keypad-actions {
        gap: 6px;
    }
    
    .keypad-key {
        width: 54px;
        height: 40px;
        font-size: 17px;
    }
    
    .keypad-row.keypad-actions .keypad-key {
        max-width: 110px;
    }
    
    .clue-digit {
        width: 28px;
        height: 34px;
        font-size: 16px;
    }
    
    .history-digit {
        width: 24px;
        height: 30px;
        font-size: 14px;
    }
    
    .clues-header {
        padding: 12px;
        font-size: 15px;
    }
    
    .clues-list {
        max-height: 350px;
    }
    
    .guess-history {
        max-height: none;
    }
    
    .history-list {
        max-height: 250px;
    }
    
    .history-header {
        font-size: 15px;
        padding: 12px;
    }
}

/* Desktop enhancements */
@media (min-width: 1024px) {
    .panel.card {
        padding-bottom: 24px;
    }
    
    .logo-icon {
        font-size: 56px;
    }
    
    .logo-text {
        font-size: 52px;
    }
    
    .digit-box {
        width: 62px;
        height: 74px;
        font-size: 32px;
        border-radius: 16px;
    }
    
    .input-section {
        padding: 20px 20px 24px;
    }
    
    .keyboard-dock .btn-row {
        max-width: 300px;
    }
    
    .keyboard-dock .btn-row .btn {
        padding: 10px 18px;
        height: 50px;
        font-size: 17px;
    }
    
    .keypad {
        gap: 8px;
        max-width: 420px;
    }
    
    .keypad-row {
        gap: 8px;
    }
    
    .keypad-row.keypad-actions {
        gap: 10px;
    }
    
    .keypad-key {
        width: 70px;
        height: 50px;
        font-size: 20px;
        border-radius: 12px;
    }
    
    .keypad-row.keypad-actions .keypad-key {
        max-width: 140px;
    }
    
    .keypad-key:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 6px 14px rgba(56, 232, 255, 0.3);
    }
    
    .clue-digit {
        width: 36px;
        height: 42px;
        font-size: 20px;
    }
    
    .guess-history {
        max-height: none;
    }
    
    .history-list {
        max-height: 450px;
    }
    
    .history-header {
        padding: 18px;
    }
    
    .history-list::-webkit-scrollbar {
        width: 8px;
    }
}
/* ===== LockCode legend (counts-only feedback) ===== */

.lockcode-legend {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 0px solid rgba(56, 232, 255, 0.15);
    background: rgba(255, 255, 255, 0.02);
    color: var(--muted, rgba(255,255,255,0.72));
    font-size: 0.85rem;
    line-height: 1.35;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
  }
  
  .lockcode-legend .legend-label {
    color: rgba(255,255,255,0.86);
  }
  
  .lockcode-legend .legend-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }
  
  .lockcode-legend .legend-sep {
    opacity: 0.45;
  }
  
  .lockcode-legend .legend-note {
    opacity: 0.95;
  }
  
  .lockcode-legend .legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 4px;
    display: inline-block;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.22) inset;
  }
  
  /* Match existing LockCode palette */
.lockcode-legend .legend-green {
    background: #5cffb1;
  }
  
  .lockcode-legend .legend-amber {
    background: #ffc857;
  }
  
  
  /* Light theme support if you use data-theme="light" */
  html[data-theme="light"] .lockcode-legend {
    border: 1px solid rgba(0,0,0,0.10);
    background: rgba(0,0,0,0.03);
    color: rgba(0,0,0,0.70);
  }
  
  html[data-theme="light"] .lockcode-legend .legend-label {
    color: rgba(0,0,0,0.86);
  }
  
