/* character-dose/style.css */

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f3f4f6;
    color: #111827;
}

.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.page-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    margin: 0 0 0.5rem;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
}

.page-subtitle {
    margin: 0;
    color: #4b5563;
}

.controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

#spinButton {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: white;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease, opacity 0.2s ease;
}

#spinButton:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.4);
}

#spinButton:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.35);
}

#spinButton:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.result-message {
    min-height: 1.25rem;
    font-size: 0.95rem;
    color: #111827;
}

.board-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.board {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.5rem;
    width: 100%;
}

.tile {
    position: relative;
    padding: 1.25rem;
    border-radius: 0.35rem;
    overflow: hidden;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.15s ease, color 0.15s ease;
    cursor: default;
    border:1px solid #9e9e9e;
}

.tile-inner {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.tile-title {
    margin: 0;
    font-size: clamp(0.8rem, 1.3vw, 1rem);
}

.tile-subtitle {
    margin: 0;
    font-size: clamp(0.65rem, 1.1vw, 0.85rem);
}

.tile.dark {
    background-color: #111827;
    color: #f9fafb;
}

.tile.light {
    background-color: #ffffff;
    color: #111827;
}

/* Highlight while cycling */
.tile.active {
    box-shadow: 0 0 0 3px #facc15, 0 8px 16px rgba(0, 0, 0, 0.35);
    transform: translateY(-2px) scale(1.02);
    z-index: 1;
}

/* Final selected tile */
.tile.selected {
    box-shadow: 0 0 0 3px #22c55e, 0 10px 22px rgba(34, 197, 94, 0.5);
    transform: translateY(-2px) scale(1.03);
}

.page-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: #6b7280;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.6);
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #ffffff;
    color: #111827;
    border-radius: 0.75rem;
    padding: 1.5rem 1.75rem 1.4rem;
    max-width: 420px;
    width: min(90%, 420px);
    border: 2px solid #ffffff;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.45);
    position: relative;
}

.modal-content.theme-dark {
    background: #111827;
    color: #f9fafb;
}

.modal-content.theme-dark .modal-subtitle {
    color: #d1d5db;
}

.modal-content.theme-dark .modal-close {
    color: #d1d5db;
}

.modal-content.theme-dark .modal-close:hover {
    color: #ffffff;
}

.modal-content.theme-light {
    background: #ffffff;
    color: #111827;
}

.modal-content.theme-light .modal-subtitle {
    color: #4b5563;
}

.modal-content.theme-light .modal-close {
    color: #6b7280;
}

.modal-content.theme-light .modal-close:hover {
    color: #111827;
}

.modal-title {
    margin: 0 0 0.5rem;
    font-size: 1.3rem;
}

.modal-subtitle {
    margin: 0;
    font-size: 0.95rem;
    color: #4b5563;
}

.modal-close {
    position: absolute;
    top: 0.4rem;
    right: 0.6rem;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.15rem 0.4rem;
    line-height: 1;
}

.modal-close:hover {
    color: #111827;
}

/* Responsiveness */
@media (max-width: 900px) {
    .page-wrapper {
        padding: 1rem;
    }

    .board {
        gap: 0.4rem;
    }
}

@media (max-width: 640px) {
    .board {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .tile {
        padding: 0.7rem;
    }
}

@media (max-width: 420px) {
    .board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

