/* Tailwind utility subset for Animal Dobble */
:root {
    color-scheme: dark;
    font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #020617;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background-color: #020617;
    color: #e2e8f0;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
    cursor: pointer;
}

.hidden {
    display: none !important;
}

.min-h-screen {
    min-height: 100vh;
}

.bg-slate-950 {
    background-color: #020617;
}

.text-slate-100 {
    color: #f1f5f9;
}

.text-slate-200 {
    color: #e2e8f0;
}

.text-slate-300 {
    color: #cbd5f5;
}

.text-slate-400 {
    color: #94a3b8;
}

.text-white {
    color: #ffffff;
}

.text-3xl {
    font-size: 1.875rem;
    line-height: 2.25rem;
}

.text-2xl {
    font-size: 1.5rem;
    line-height: 2rem;
}

.text-xl {
    font-size: 1.25rem;
    line-height: 1.75rem;
}

.text-lg {
    font-size: 1.125rem;
    line-height: 1.75rem;
}

.text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.uppercase {
    text-transform: uppercase;
}

.tracking-wide {
    letter-spacing: 0.15em;
}

.max-w-6xl {
    max-width: 72rem;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.py-6 {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-1 {
    flex: 1 1 0%;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.justify-end {
    justify-content: flex-end;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

.grid {
    display: grid;
}

.text-center {
    text-align: center;
}

.rounded-3xl {
    border-radius: 1.5rem;
}

.rounded-xl {
    border-radius: 0.75rem;
}

.rounded-lg {
    border-radius: 0.5rem;
}

.rounded-full {
    border-radius: 9999px;
}

.border {
    border-width: 1px;
    border-style: solid;
}

.border-slate-700 {
    border-color: #334155;
}

.border-slate-800 {
    border-color: #1e293b;
}

.border-white\/20 {
    border-color: rgba(255, 255, 255, 0.2);
}

.shadow-lg {
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.35);
}

.transition {
    transition: all 0.25s ease;
}

.duration-300 {
    transition-duration: 300ms;
}

.ease-out {
    transition-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1);
}

.bg-slate-900\/70 {
    background-color: rgba(15, 23, 42, 0.7);
}

.bg-slate-900\/50 {
    background-color: rgba(15, 23, 42, 0.5);
}

.bg-indigo-500\/20 {
    background-color: rgba(99, 102, 241, 0.2);
}

.text-lime-300 {
    color: #bef264;
}

.text-amber-300 {
    color: #fcd34d;
}

.text-rose-300 {
    color: #fda4af;
}

.text-emerald-300 {
    color: #6ee7b7;
}

@media (min-width: 768px) {
    .md\:flex-row {
        flex-direction: row;
    }

    .md\:items-center {
        align-items: center;
    }

    .md\:justify-between {
        justify-content: space-between;
    }

    .md\:inline-flex {
        display: inline-flex;
    }
}

@media (min-width: 1024px) {
    .lg\:flex-row {
        flex-direction: row;
    }

    .lg\:hidden {
        display: none !important;
    }
}

/************ Custom components ************/
.status-row {
    width: 100%;
    justify-content: flex-end;
}

@media (max-width: 1024px) {
    .status-row {
        justify-content: space-between;
    }
}

@media (max-width: 768px) {
    .status-row {
        gap: 0.85rem;
    }
}

@media (max-width: 560px) {
    .status-row {
        gap: 0.7rem;
    }
}

@media (max-width: 420px) {
    .status-row {
        gap: 0.6rem;
    }
}

.status-card {
    min-width: 112px;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.18), rgba(236, 72, 153, 0.12));
    border: 1px solid rgba(148, 163, 184, 0.25);
    text-align: center;
    flex: 1 1 140px;
}

.status-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(226, 232, 240, 0.75);
    margin-bottom: 0.35rem;
}

.status-value {
    font-size: 1.35rem;
    font-weight: 600;
    color: #f8fafc;
    letter-spacing: 0.05em;
}

@media (max-width: 768px) {
    .status-card {
        min-width: 0;
        flex: 1 1 calc(33.333% - 0.75rem);
        padding: 0.6rem 0.75rem;
    }

    .status-label {
        font-size: 0.65rem;
        letter-spacing: 0.1em;
    }

    .status-value {
        font-size: 1.15rem;
        letter-spacing: 0.03em;
    }
}

@media (max-width: 560px) {
    .status-card {
        flex: 1 1 calc(33.333% - 0.65rem);
        padding: 0.55rem 0.65rem;
    }

    .status-value {
        font-size: 1.05rem;
    }
}

@media (max-width: 420px) {
    .status-card {
        flex: 1 1 calc(33.333% - 0.5rem);
        padding: 0.5rem 0.6rem;
        border-radius: 0.9rem;
    }

    .status-value {
        font-size: 0.95rem;
        letter-spacing: 0.02em;
    }

    .status-label {
        font-size: 0.62rem;
        letter-spacing: 0.09em;
    }
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 9999px;
    font-weight: 600;
    border: 1px solid transparent;
    padding: 0.65rem 1.75rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1, #ec4899);
    color: #ffffff;
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.01);
}

.btn-secondary {
    background: rgba(15, 23, 42, 0.6);
    color: #f8fafc;
    border-color: rgba(148, 163, 184, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

.info-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 320px;
}

.panel-block {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 1.25rem;
    padding: 1.25rem;
    backdrop-filter: blur(12px);
    box-shadow: 0 24px 50px rgba(2, 6, 23, 0.45);
}

.panel-block summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    list-style: none;
    gap: 0.5rem;
}

.panel-block summary .panel-title {
    margin-bottom: 0;
}

.panel-block summary::-webkit-details-marker {
    display: none;
}

.panel-block summary::after {
    content: '▾';
    font-size: 0.75rem;
    color: rgba(148, 163, 184, 0.75);
    transition: transform 0.25s ease;
}

.panel-block[open] summary::after {
    transform: rotate(180deg);
}

.panel-copy {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: rgba(226, 232, 240, 0.85);
}

.panel-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    letter-spacing: 0.08em;
    color: #f4f4f5;
}

.leaderboard {
    list-style: decimal inside;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: rgba(226, 232, 240, 0.85);
    max-height: 220px;
    overflow-y: auto;
    padding: 0;
    margin: 0;
}

.leaderboard li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.4rem 0.6rem;
    background: rgba(79, 70, 229, 0.05);
    border-radius: 0.75rem;
}

.rules {
    margin: 0;
    padding-left: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    color: rgba(226, 232, 240, 0.85);
    font-size: 0.85rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    background: rgba(15, 23, 42, 0.55);
    border-radius: 1.5rem;
    padding: 1.5rem;
    border: 1px solid rgba(87, 97, 118, 0.25);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    min-height: 420px;
    width: 100%;
    overflow: hidden;
}

.card {
    position: relative;
    height: 148px;
    perspective: 800px;
    border: none;
    background: transparent;
    width: 100%;
    padding: 0;
}

.card-inner {
    position: absolute;
    inset: 0;
    border-radius: 1.25rem;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    cursor: pointer;
}

.card.is-flipped .card-inner,
.card.is-matched .card-inner {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.75rem;
    border: 2px solid transparent;
}

.card-face.front {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.9));
    border-color: rgba(99, 102, 241, 0.45);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.card-face.back {
    transform: rotateY(180deg);
    background: linear-gradient(145deg, rgba(79, 70, 229, 0.5), rgba(236, 72, 153, 0.45));
    border-color: rgba(236, 72, 153, 0.4);
    color: #0f172a;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.card.is-matched .card-inner {
    animation: matched-burst 0.65s ease forwards;
}

.card.is-matched .card-face.back {
    background: linear-gradient(160deg, rgba(34, 197, 94, 0.85), rgba(59, 130, 246, 0.75));
    border-color: rgba(96, 165, 250, 0.6);
    color: #0b1120;
}

.card:focus-visible {
    outline: 3px solid rgba(129, 140, 248, 0.6);
    outline-offset: 4px;
}

@keyframes matched-burst {
    0% {
        transform: rotateY(180deg) scale(1);
    }
    40% {
        transform: rotateY(180deg) scale(1.08);
    }
    70% {
        transform: rotateY(180deg) scale(0.96);
    }
    100% {
        transform: rotateY(180deg) scale(1);
    }
}

.hint-banner {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.9rem;
    color: rgba(148, 163, 184, 0.85);
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.78);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    z-index: 50;
}

.overlay-card {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 1.75rem;
    padding: 2rem;
    max-width: 420px;
    width: 100%;
    text-align: center;
    backdrop-filter: blur(18px);
    box-shadow: 0 40px 100px rgba(15, 23, 42, 0.55);
}

.overlay-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.overlay-message {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: rgba(226, 232, 240, 0.9);
}

.overlay-details {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    color: rgba(148, 163, 184, 0.9);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.overlay-leaderboard {
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.overlay-leaderboard-title {
    font-size: 0.85rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(226, 232, 240, 0.8);
}

.overlay-leaderboard-list {
    margin: 0;
    padding-left: 1.1rem;
    max-height: 180px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: rgba(226, 232, 240, 0.9);
    list-style: decimal inside;
}

.overlay-leaderboard-list li {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
}

.overlay-leaderboard-list li span:last-child {
    opacity: 0.85;
}

.overlay-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.name-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.input {
    padding: 0.65rem 1rem;
    border-radius: 0.85rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.9);
    color: #f8fafc;
}

.input:focus {
    outline: 2px solid rgba(99, 102, 241, 0.6);
}

.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 184, 166, 0.85);
    color: #0b1120;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-weight: 600;
    box-shadow: 0 20px 45px rgba(13, 148, 136, 0.3);
    animation: toast-pop 2.2s ease forwards;
    z-index: 60;
}

@keyframes toast-pop {
    0% {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    15% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    70% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, 10px);
    }
}

@media (max-width: 768px) {
    .card {
        height: 120px;
    }

    .card-grid {
        min-height: 320px;
        padding: 1.25rem;
        gap: 0.85rem;
    }
}

@media (max-width: 560px) {
    .card-grid {
        padding: 1.1rem;
        gap: 0.75rem;
    }

    .card {
        height: 110px;
    }
}

@media (max-width: 420px) {
    .card-grid {
        padding: 0.9rem;
        gap: 0.65rem;
    }

    .card {
        height: 100px;
    }
}
.card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.75rem;
}

.card-icon {
    font-size: 3rem;
    filter: drop-shadow(0 10px 20px rgba(15, 23, 42, 0.45));
}

.card-name {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(15, 23, 42, 0.85);
}

.card-face.front {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    color: rgba(148, 163, 184, 0.9);
    font-weight: 600;
    letter-spacing: 0.18em;
}

.card-face.front .card-pattern {
    font-size: 2.5rem;
    filter: drop-shadow(0 8px 16px rgba(99, 102, 241, 0.45));
}

.card-face.front .card-label {
    font-size: 0.85rem;
}

.card.disable {
    pointer-events: none;
}

.card-grid.shake {
    animation: grid-shake 0.35s ease;
}

@keyframes grid-shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    50% { transform: translateX(6px); }
    75% { transform: translateX(-3px); }
    100% { transform: translateX(0); }
}
button[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Mobile collapsible sections */
/* Safe area padding for mobile */
body {
    padding-bottom: env(safe-area-inset-bottom);
}

/* Play area optimization */
@media (max-width: 1024px) {
    .info-panel {
        max-width: 100%;
    }
    
    .lg\:block {
        display: block;
    }
}

@media (max-width: 1023px) {
    .lg\:block {
        display: none;
    }
}
