/* ==========================================================================
   Design tokens & shared components
   Used by index.css / style.css / arena.css so every page (Home, PVP,
   Challenge, Arena) shares one visual language.
   ========================================================================== */

:root {
    --color-red: #e3350d;
    --color-red-dark: #b32b0c;
    --color-blue: #2a75bb;
    --color-blue-dark: #1b4f8c;
    --color-yellow: #ffcb05;
    --color-yellow-dark: #e0ac00;

    --color-bg-start: #6ec1ff;
    --color-bg-end: #1b4f8c;

    --color-card: #ffffff;
    --color-text: #23292f;
    --color-text-muted: #5b6672;
    --color-border: #e4e9f0;
    --color-surface: #f7f9fc;

    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;

    --shadow-card: 0 20px 45px -12px rgba(11, 45, 84, 0.35);
    --shadow-btn: 0 6px 14px rgba(227, 53, 13, 0.35);

    --font-heading: "Fredoka", sans-serif;
    --font-body: "Nunito", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 24px;
    background:
        radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.18), transparent 40%),
        radial-gradient(circle at 88% 82%, rgba(255, 255, 255, 0.14), transparent 45%),
        linear-gradient(135deg, var(--color-bg-start), var(--color-bg-end));
    background-attachment: fixed;
}

.container {
    position: relative;
    max-width: 800px;
    min-height: 600px;
    text-align: center;
    padding: 32px;
    background-color: var(--color-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(90deg, var(--color-red), var(--color-yellow), var(--color-blue));
}

h1 {
    font-family: var(--font-heading);
    color: var(--color-red);
    font-size: 26px;
    font-weight: 600;
    letter-spacing: 0.3px;
    margin: 8px 0 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

h1::before {
    content: "";
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(
        180deg,
        var(--color-red) 0%,
        var(--color-red) 46%,
        #23292f 46%,
        #23292f 54%,
        #fff 54%,
        #fff 100%
    );
    border: 2px solid #23292f;
    box-shadow: inset 0 0 0 3px #fff;
}

h2 {
    font-family: var(--font-heading);
    color: var(--color-blue-dark);
    font-weight: 600;
}

p {
    color: var(--color-text-muted);
    line-height: 1.6;
}

label {
    font-family: var(--font-body);
    font-weight: 700;
    color: var(--color-blue-dark);
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

input[type="text"],
input[type="file"] {
    font-family: var(--font-body);
    padding: 11px 14px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    font-size: 15px;
    width: 100%;
    margin-bottom: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--color-blue);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(42, 117, 187, 0.15);
}

button,
.button {
    font-family: var(--font-heading);
    padding: 12px 22px;
    background: linear-gradient(135deg, var(--color-red), var(--color-red-dark));
    color: #fff;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-btn);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

button:hover,
.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 22px rgba(227, 53, 13, 0.4);
}

button:active,
.button:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(227, 53, 13, 0.35);
}

button:focus-visible,
.button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid var(--color-yellow);
    outline-offset: 2px;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.home-button {
    position: absolute;
    top: 20px;
    left: 20px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--color-blue);
    color: #fff;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 12px;
    padding: 8px 14px;
    border-radius: 999px;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(42, 117, 187, 0.35);
    transition: background 0.2s ease, transform 0.15s ease;
}

.home-button:hover {
    background: var(--color-blue-dark);
    transform: translateY(-1px);
}

.home-icon {
    font-size: 12px;
    margin: 0;
}

.versus {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-yellow-dark), var(--color-yellow));
    box-shadow: 0 6px 14px rgba(224, 172, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 10px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
}

.modal-content {
    position: relative;
    background-color: var(--color-card);
    margin: 8% auto;
    padding: 24px;
    border: none;
    width: 88%;
    max-width: 420px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    text-align: center;
    animation: modal-pop 0.18s ease;
}

@keyframes modal-pop {
    from {
        opacity: 0;
        transform: scale(0.94);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.close {
    color: var(--color-text-muted);
    float: right;
    font-size: 22px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.15s ease;
}

.close:hover,
.close:focus {
    color: var(--color-red);
    text-decoration: none;
}

.pokemon-details-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 14px;
}

.pokemon-details-table td {
    padding: 8px 10px;
    border: 1px solid var(--color-border);
}

.table-key {
    font-weight: 700;
    background-color: var(--color-surface);
    text-align: left;
    width: 40%;
    color: var(--color-blue-dark);
}

.table-value {
    text-align: left;
}

.battle-log {
    margin-top: 20px;
    max-height: 260px;
    overflow-y: auto;
    border-radius: var(--radius-sm);
    background: #101826;
    padding: 4px;
}

.log-content {
    font-family: "Courier New", monospace;
    font-size: 13px;
    color: #8affab;
    padding: 14px;
    white-space: pre-line;
    line-height: 1.55;
    text-align: left;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--color-blue);
    border-radius: 4px;
}

.hidden {
    display: none !important;
}

/* Choices.js dropdown theming */
.choices {
    width: 100% !important;
}

.choices__inner {
    min-width: 200px;
    max-width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: var(--color-surface) !important;
    border: 2px solid var(--color-border) !important;
    border-radius: var(--radius-sm) !important;
}

.choices.is-focused .choices__inner,
.choices.is-open .choices__inner {
    border-color: var(--color-blue) !important;
}

.choices__list--dropdown {
    border-color: var(--color-border) !important;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm) !important;
    overflow: hidden;
}

.choices__list--dropdown .choices__item--selectable.is-highlighted {
    background-color: var(--color-blue) !important;
    color: #fff !important;
}

.choices__list--multiple .choices__item {
    background: var(--color-blue) !important;
    border-color: var(--color-blue-dark) !important;
}

/* Responsive base */
@media (max-width: 600px) {
    .container {
        padding: 24px 18px;
        min-height: 0;
    }

    h1 {
        font-size: 20px;
    }

    .home-button {
        top: 14px;
        left: 14px;
    }
}
