:root {
    --color-bg-light: #f5fbff;
    --color-primary: #0f394c;
    --color-primary-rgb: 15, 57, 76;
    --color-accent: #49b5e7;
    --color-accent-rgb: 73, 181, 231;
    --color-white: #ffffff;
    --color-dark: #0f394c;

    --color-yellow-100: #fef9c3;
    --color-yellow-500: #eab308;
    --color-yellow-600: #ca8a04;
    --color-blue-500: #3b82f6;
    --color-red-100: #fee2e2;
    --color-red-400: #f87171;
    --color-red-600: #dc2626;
    --color-green-400: #4ade80;
    --color-green-600: #16a34a;
}


body {
    background-color: var(--color-bg-light);
    color: var(--color-dark);
}

#game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    max-width: 500px;
    margin: auto;
    text-align: center;
}

.screen-container {
    width: 100%;
    text-align: center;
}

p {
    margin-bottom: 0;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes slideUpFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleUpFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleDownFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-4px);
    }

    40%,
    80% {
        transform: translateX(4px);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .5;
    }
}

@keyframes scorePopup {
    0% {
        opacity: 0;
        transform: scale(0.5) translate(0, 0);
    }

    20% {
        opacity: 1;
        transform: scale(1.5) translate(0, -50px);
    }

    80% {
        opacity: 1;
        transform: scale(1) translate(0, -200px);
    }

    100% {
        opacity: 0;
        transform: scale(0.8) translate(0, -250px);
    }
}

@keyframes tilePop {
    0% {
        transform: scale(0);
    }

    60% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease-out forwards;
}

.animate-slideUp {
    animation: slideUpFadeIn 0.5s ease-out forwards;
}

.animate-scaleUp {
    animation: scaleUpFadeIn 0.3s ease-out forwards;
}

.animate-shake {
    animation: shake 0.4s cubic-bezier(.36, .07, .19, .97) both;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.game-container {
    width: 100%;
    max-width: 32rem;
    /* max-w-lg */
}

#game-container .card {
    background-color: white;
    padding: 1.5rem;
    /* p-6 */
    border-radius: 1.5rem;
    /* rounded-3xl */
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    /* shadow-xl */
    border-bottom: 4px solid rgba(var(--color-primary-rgb), 0.1);
    margin-top: 2rem;
    margin-bottom: 2rem;
    border-color: aliceblue;
}

#tut-skip {
    border: none;
    background: white;
}

#tut-skip:hover {
    background: #f0f0f0;
}

#tut-next:hover {
    background-color: color-mix(in oklab, var(--color-primary) 90%, transparent) !important;
}

.card-playing {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 1rem;
    /* rounded-2xl */
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(var(--color-primary-rgb), 0.05);
    background: white;
}

.heading-xl {
    font-size: 3.75rem;
    /* text-6xl */
    font-weight: 900;
    /* font-black */
    color: var(--color-primary);
    line-height: 1;
    letter-spacing: -0.05em;
    /* tracking-tighter */
}

.text-accent {
    color: var(--color-accent);
}

.text-primary {
    color: var(--color-primary);
}

.text-yellow-600 {
    color: var(--color-yellow-600);
}

.subtitle {
    color: rgba(var(--color-primary-rgb), 0.6);
    font-weight: 500;
    margin-top: 0.5rem;
}

.stat-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
}

.stat-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primarys {
    width: 100%;
    background-color: var(--color-primary);
    color: white;
    padding: 1rem;
    border-radius: 1rem;
    font-weight: 700;
    font-size: 1.25rem;
    box-shadow: 0 10px 15px -3px rgba(var(--color-primary-rgb), 0.2);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    gap: 0.5rem;
}

.btn-primarys:hover {
    background-color: rgba(var(--color-primary-rgb), 0.9);
}

.btn-secondarys {
    width: 100%;
    background-color: white;
    color: rgba(var(--color-primary-rgb), 0.6);
    padding: 1rem;
    border-radius: 1rem;
    font-weight: 700;
    font-size: 0.875rem;
    border: 1px solid rgba(var(--color-primary-rgb), 0.05);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-secondarys:hover {
    background-color: rgba(var(--color-primary-rgb), 0.05);
}

.btn-accent {
    width: 100%;
    background-color: var(--color-accent);
    color: white;
    padding: 1.25rem;
    border-radius: 1rem;
    font-weight: 700;
    font-size: 1.25rem;
    box-shadow: 0 10px 15px -3px rgba(var(--color-accent-rgb), 0.2);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-accent:hover {
    background-color: rgba(var(--color-accent-rgb), 0.9);
}

.word-tile {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
    background-color: white;
    color: var(--color-primary);
    border: 2px solid rgba(var(--color-primary-rgb), 0.1);
    animation: tilePop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.word-tile.correct {
    background-color: var(--color-green-400);
    color: white;
    border-color: var(--color-green-600);
    transform: scale(1.1);
}

.input-field {
    width: 100%;
    background-color: white;
    text-align: center;
    font-size: 2.25rem;
    font-weight: 900;
    padding: 1.5rem 0;
    border-radius: 1.5rem;
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
    border: 4px solid rgba(var(--color-primary-rgb), 0.1);
    outline: none;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-primary);
    transition: all 0.2s;
}

.input-field:focus {
    border-color: var(--color-accent);
}

.input-field.correct {
    border-color: var(--color-green-400);
    color: var(--color-green-600);
}

.input-field.wrong {
    border-color: var(--color-red-400);
    color: var(--color-red-600);
}

.input-field.hint {
    border-color: var(--color-yellow-500);
    box-shadow: 0 10px 15px -3px rgba(var(--color-yellow-500), 0.2);
}

.game-actions {
    position: absolute;
    bottom: -3rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.btn-small {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    background-color: white;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(var(--color-primary-rgb), 0.05);
    font-size: 0.875rem;
    font-weight: 700;
    color: rgba(var(--color-primary-rgb), 0.6);
    transition: color 0.2s;
}

.btn-small:hover:not(:disabled) {
    color: var(--color-accent);
}

.btn-small:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.progress-bar {
    height: 0.5rem;
    background-color: rgba(var(--color-primary-rgb), 0.05);
    border-radius: 9999px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-fill {
    height: 100%;
    background-color: var(--color-accent);
    width: 0%;
    transition: width 0.3s ease-out;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(var(--color-primary-rgb), 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 1rem;
}

.modal-content {
    background-color: white;
    width: 100%;
    max-width: 24rem;
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    padding: 2rem;
    text-align: center;
}

.score-popup {
    position: absolute;
    z-index: 10;
    font-weight: 900;
    font-size: 1.5rem;
    pointer-events: none;
    animation: scorePopup 0.8s ease-out forwards;
}

/* Helpers */
.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.items-center {
    align-items: center;
}

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.space-y-2>*+* {
    margin-top: 0.5rem;
}

.space-y-4>*+* {
    margin-top: 1rem;
}

.space-y-6>*+* {
    margin-top: 1.5rem;
}

.space-y-8>*+* {
    margin-top: 2rem;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.uppercase {
    text-transform: uppercase;
}

.italic {
    font-style: italic;
}

.font-bold {
    font-weight: 700;
}

.font-black {
    font-weight: 900;
}

.leading-none {
    line-height: 1;
}

.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.w-full {
    width: 100%;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.pb-4 {
    padding-bottom: 1rem;
}

.pt-4 {
    padding-top: 1rem;
}

.inline-block {
    display: inline-block;
}

.flex-1 {
    flex: 1;
}