/* Farkle Calculator Styles */

#farkle-calculator {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.calculator-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 5px;
    padding: .5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.input-section {
    background: white;
    border-radius: 5px;
    padding: 2rem;
    margin-bottom: 0.5rem;
}

.input-section h3 {
    color: #667eea;
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    text-align: left;
}

.dice-input-wrapper {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 2rem;
}

.dice-labels {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 70px;
}

.label-row {
    height: 70px;
    display: flex;
    align-items: center;
    font-weight: 600;
    color: #4a5568;
    font-size: 0.95rem;
}

.locked-row {
    height: 20px;
    font-size: 0.85rem;
    color: #718096;
}

.dice-container {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
    flex: 1;
}

.die-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.die-select {
    width: 70px;
    height: 70px;
    font-size: 2rem;
    text-align: center;
    border: 3px solid #667eea;
    border-radius: 10px;
    background: #f7fafc;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    color: #2d3748;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.die-select:hover {
    background: #edf2f7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.die-select:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(118, 75, 162, 0.2);
}

.die-select.locked {
    background: #fef5e7;
    border-color: #f39c12;
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.2);
}

.lock-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
}

.controls-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

.control-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-end;
    gap: 1rem;
}

.score-input {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.score-input label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

.score-input input {
    width: 120px;
    padding: 0.5rem;
    font-size: 1rem;
    text-align: center;
    border: 2px solid #cbd5e0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

#dice-list {
    font-family: monospace;
}

.score-input input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.clear-btn, .reset-btn, .roll-btn {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: #718096;
    background: white;
    border: 2px solid #cbd5e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    align-self: flex-end;
}

.reset-btn {
    color: #667eea;
    border-color: #667eea;
}

.roll-btn {
    color: #667eea;
    border-color: #667eea;
}

.clear-btn:hover, .reset-btn:hover, .roll-btn:hover {
    background: #f7fafc;
    border-color: #a0aec0;
    color: #4a5568;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.reset-btn:hover, .roll-btn:hover {
    background: #eef2ff;
    border-color: #667eea;
    color: #5568d3;
}

.clear-btn:active, .reset-btn:active, .roll-btn:active {
    transform: translateY(0);
}

.result-section {
    background: white;
    border-radius: 8px;
    padding: 2rem;
}

.result-section h3 {
    color: #667eea;
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    text-align: left;
}

/* Table Styles */
.moves-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.moves-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.moves-table thead th {
    color: white;
    padding: 1rem;
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
    vertical-align: middle;
}

.moves-table tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid #e2e8f0;
}

.moves-table tbody tr:last-child {
    border-bottom: none;
}

.moves-table tbody tr:hover:not(.placeholder-row) {
    background: #f7fafc;
    transform: scale(1.02);
}

.moves-table tbody td {
    padding: 1rem;
    text-align: center;
    font-size: 1rem;
    vertical-align: middle;
}

.dice-cell {
    font-size: 2rem !important;
    font-weight: bold;
    transition: opacity 0.3s ease;
    padding: 0rem !important;
}

.keep-cell {
    font-size: 2rem;
    color: #48bb78;
}

.score-cell {
    font-weight: bold;
    color: #e67e22;
    font-size: 1.25rem;
}

.bust-cell {
    font-weight: 600;
    color: #e53e3e;
}

.placeholder-row td {
    padding: 2rem;
    color: #a0aec0;
    font-style: italic;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

.move-row {
    opacity: 0;
}

.number-animate {
    display: inline-block;
    transition: transform 0.2s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    #farkle-calculator {
        margin: 1rem auto;
        padding: 0 0.5rem;
    }
    
    .calculator-container {
        padding: 0.5rem;
    }
    
    .input-section,
    .result-section {
        padding: 0.75rem;
    }
    
    .input-section h3,
    .result-section h3 {
        margin-bottom: 0.75rem;
        font-size: 1.1rem;
    }
    
    .dice-input-wrapper {
        flex-direction: column;
        align-items: stretch;
        margin-bottom: 1rem;
    }
    
    .dice-labels {
        flex-direction: row;
        justify-content: space-around;
        min-width: auto;
        margin-bottom: 0.5rem;
    }
    
    .label-row {
        height: auto;
    }
    
    .dice-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    .die-select {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .controls-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        margin-top: 1rem;
    }
    
    .score-input {
        align-items: center;
    }
    
    .score-input label {
        margin-bottom: 0.25rem;
        font-size: 0.9rem;
    }
    
    .score-input input {
        width: 100%;
        max-width: 200px;
        padding: 0.5rem;
    }
    
    .clear-btn {
        align-self: stretch;
        padding: 0.5rem 1rem;
    }
    
    .moves-table thead th {
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
    }
    
    .moves-table tbody td {
        padding: 0.5rem 0.25rem;
        font-size: 0.8rem;
    }
    
    .dice-cell {
        font-size: 1.4rem !important;
        line-height: 1.2;
    }
    
    .score-cell {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    #farkle-calculator {
        margin: 0.5rem auto;
        padding: 0 0.25rem;
    }
    
    .calculator-container {
        padding: 0.25rem;
    }
    
    .input-section,
    .result-section {
        padding: 0.5rem;
    }
    
    .input-section h3,
    .result-section h3 {
        margin-bottom: 0.5rem;
        font-size: 0.95rem;
    }
    
    .dice-input-wrapper {
        flex-direction: column;
        margin-bottom: 0.75rem;
    }
    
    .dice-labels {
        display: none;
    }
    
    .dice-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.35rem;
    }
    
    .die-select {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        border-width: 2px;
    }
    
    .lock-checkbox {
        width: 18px;
        height: 18px;
    }
    
    .controls-row {
        gap: 0.5rem;
        margin-top: 0.75rem;
    }

    .control-group {
        gap: 0.5rem;
        justify-content: space-between;
        align-items: stretch;
    }    
    .control-group.button-row {
        gap: 0.5rem;
        justify-content: space-between;
        height: 40px;
    }
    
    .score-input {
        flex: 0 0 calc(50% - 0.25rem);
        min-width: 0;
        align-items: stretch;
    }
    
    .score-input label {
        font-size: 0.85rem;
    }
    
    .score-input input {
        width: 100%;
        padding: 0.4rem;
        font-size: 1rem;
    }
    
    .reset-btn, .roll-btn, .clear-btn {
        flex: 0 0 calc(50% - 0.25rem);
        padding: 0.4rem 0.4rem;
        font-size: 0.9rem;
        align-self: auto;
    }
    
    .moves-table {
        font-size: 0.75rem;
    }
    
    .moves-table thead th,
    .moves-table tbody td {
        padding: 0.4rem 0.15rem;
    }
    
    .dice-cell {
        font-size: 1.3rem !important;
        line-height: 1.2;
    }
    
    .score-cell {
        font-size: 0.85rem;
    }
    
    .bust-cell {
        font-size: 0.8rem;
    }
}
