:root {
    --bg: #050805;
    --bg-secondary: #0b120b;
    --surface: rgba(255, 255, 255, 0.06);
    --surface-strong: rgba(255, 255, 255, 0.09);
    --surface-soft: rgba(0, 0, 0, 0.26);

    --text: #ffffff;
    --text-muted: #b8c7b8;
    --text-soft: #e8ffe8;

    --border: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.18);

    --primary: #39d515;
    --primary-hover: #2fb812;
    --success: #39d515;
    --success-hover: #2fb812;
    --danger: #ff5b5b;
    --danger-hover: #e94a4a;

    --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 14px 30px rgba(0, 0, 0, 0.28);
    --shadow-sm: 0 8px 20px rgba(0, 0, 0, 0.16);

    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;

    --transition: 0.25s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 32px 16px;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(57, 213, 21, 0.18), transparent 30%),
        radial-gradient(circle at bottom right, rgba(57, 213, 21, 0.08), transparent 28%),
        var(--bg);
}

a {
    color: inherit;
}

/* CONTAINERS */

.container {
    width: min(520px, 100%);
    padding: 28px;
    border-radius: var(--radius-xl);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

h1 {
    text-align: center;
    font-size: clamp(1.7rem, 2vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 10px;
    color: var(--text);
}

.container p,
.home-container p,
.page-header p {
    color: var(--text-muted);
    line-height: 1.55;
}

/* FORM */

form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 22px;
}

.form-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.24);
    border: 1px solid var(--border);
}

.section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-soft);
    margin-bottom: 2px;
}

.submit-area {
    margin-top: 6px;
    display: flex;
}

.submit-area button {
    width: 100%;
}

/* INPUTS */

input,
select,
button,
.download-link,
.action-btn,
.back-btn {
    font: inherit;
}

input,
select {
    width: 100%;
    min-height: 50px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    outline: none;
    background: rgba(0, 0, 0, 0.35);
    color: var(--text);
    transition:
        border-color var(--transition),
        box-shadow var(--transition),
        background var(--transition),
        transform var(--transition);
}

input::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

/* corrige texto branco ilegível no select */
select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    color: var(--text);
}

/* corrige dropdown branco ilegível */
select option {
    background: #050805;
    color: #ffffff;
}

input:hover,
select:hover {
    border-color: var(--border-strong);
    background: rgba(0, 0, 0, 0.42);
}

input:focus,
select:focus {
    border-color: rgba(57, 213, 21, 0.75);
    box-shadow: 0 0 0 4px rgba(57, 213, 21, 0.12);
    background: rgba(0, 0, 0, 0.35);
}

input[type="file"] {
    cursor: pointer;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
}

input[type="file"]::file-selector-button {
    margin-right: 12px;
    border: none;
    border-radius: 10px;
    padding: 10px 14px;
    background: var(--primary);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}

input[type="file"]::file-selector-button:hover {
    background: var(--primary-hover);
}

/* BUTTONS */

button,
.download-link,
.action-btn,
.back-btn,
.home-card,
.tool-card {
    transition:
        transform var(--transition),
        box-shadow var(--transition),
        background var(--transition),
        border-color var(--transition),
        opacity var(--transition);
}

button,
.download-link,
.action-btn,
.back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 50px;
    padding: 14px 16px;
    border: none;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: #071007;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    text-align: center;
}

button {
    background: var(--success);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: var(--success-hover);
}

button:active,
.download-link:active,
.action-btn:active,
.back-btn:active,
.home-card:active,
.tool-card:active {
    transform: translateY(0);
}

.actions-area {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
}

.action-btn {
    min-height: 50px;
}

.download-link {
    background: #ffffff;
    color: #101510;
}

.download-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.reset-btn {
    background: rgba(255, 91, 91, 0.14);
    color: #ffb4b4;
    border: 1px solid rgba(255, 91, 91, 0.32);
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.back-btn {
    background: #2a2f2a;
    color: #ffffff;
}

.back-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* LOADING */

.loading-screen {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: rgba(5, 8, 5, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
}

.loading-screen.active {
    display: flex;
}

.loading-box {
    width: min(360px, 100%);
    padding: 28px;
    border-radius: 22px;
    background: var(--surface-strong);
    border: 1px solid var(--border);
    text-align: center;
    color: var(--text);
    box-shadow: var(--shadow-lg);
}

.loading-box h2,
.loading-box h3,
.loading-box p {
    margin-bottom: 8px;
}

.progress-bar {
    width: 100%;
    height: 12px;
    margin: 18px 0 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.18);
}

.progress-fill {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #39d515, #b8ff9b);
    transition: width 0.25s ease;
}

#progressText {
    font-size: 0.95rem;
    color: var(--text-soft);
}

/* CANVAS */

.hidden-canvas {
    display: none;
}

/* MODAL */

.modal {
    position: fixed;
    inset: 0;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 24px;
    background: rgba(5, 8, 5, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 10000;
}

.modal.active {
    display: flex;
}

.modal-content {
    position: relative;
    max-width: 95vw;
    max-height: 95vh;
    padding: 14px;
    border-radius: 20px;
    background: rgba(5, 8, 5, 0.95);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

.modal-content img {
    display: block;
    max-width: 100%;
    max-height: 88vh;
    border-radius: 14px;
}

.close-modal {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 91, 91, 0.14);
    color: #ffb4b4;
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition), filter var(--transition);
}

.close-modal:hover {
    transform: scale(1.06);
    filter: brightness(1.05);
}

/* HOME */

.home-page {
    min-height: 100vh;
    padding: 32px 16px;
    background:
        radial-gradient(circle at top left, rgba(57, 213, 21, 0.18), transparent 28%),
        radial-gradient(circle at bottom right, rgba(57, 213, 21, 0.08), transparent 24%),
        var(--bg);
    color: var(--text);
    display: flex;
    justify-content: center;
    align-items: center;
}

.home-shell {
    width: min(1000px, 100%);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.home-hero {
    text-align: center;
    padding: 32px 24px 12px;
}

.home-hero h1 {
    margin-bottom: 10px;
    font-size: clamp(2rem, 3vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.04em;
}

.home-hero p {
    max-width: 640px;
    margin: 0 auto;
    color: #b8c7b8;
    font-size: 1rem;
    line-height: 1.6;
}

.home-panel {
    padding: 28px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.home-section {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.24);
    overflow: hidden;
}

.home-section summary {
    list-style: none;
    cursor: pointer;
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: background 0.25s ease;
}

.home-section summary::-webkit-details-marker {
    display: none;
}

.home-section summary:hover {
    background: rgba(255, 255, 255, 0.03);
}

.home-section summary span {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
}

.home-section summary small {
    color: #b8c7b8;
    font-size: 0.92rem;
}

.home-grid {
    padding: 0 22px 22px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.tool-card {
    display: block;
    text-decoration: none;
    color: #ffffff;
    padding: 18px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(57, 213, 21, 0.18), rgba(57, 213, 21, 0.08));
    border: 1px solid rgba(57, 213, 21, 0.22);
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.22);
    border-color: rgba(57, 213, 21, 0.34);
    background: linear-gradient(135deg, rgba(57, 213, 21, 0.28), rgba(57, 213, 21, 0.14));
}

.tool-card-title {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.tool-card-subtitle {
    display: block;
    color: #b8c7b8;
    font-size: 0.93rem;
    line-height: 1.45;
}

.home-footer {
    text-align: center;
    padding-bottom: 8px;
}

.home-footer a {
    color: #b8c7b8;
    text-decoration: none;
    transition: color 0.25s ease;
}

.home-footer a:hover {
    color: #ffffff;
}

/* PÁGINAS INTERNAS */

body:not(.home-page) {
    align-items: flex-start;
}

.page-shell {
    width: min(760px, 100%);
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin: 0 auto;
}

.page-shell .container {
    margin: 0 auto;
}

.page-header {
    text-align: center;
    padding: 8px 8px 2px;
}

.page-header h1 {
    margin-bottom: 10px;
}

.page-header p {
    max-width: 560px;
    margin: 0 auto;
}

/* EXTRAS */

::selection {
    background: rgba(57, 213, 21, 0.35);
    color: white;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
.download-link:focus-visible,
.back-btn:focus-visible,
.close-modal:focus-visible,
.home-card:focus-visible,
.tool-card:focus-visible,
summary:focus-visible,
a:focus-visible {
    outline: 2px solid rgba(57, 213, 21, 0.9);
    outline-offset: 2px;
}

/* RESPONSIVO */

@media (max-width: 640px) {
    .home-page {
        padding: 20px 12px;
        align-items: flex-start;
    }

    .home-panel {
        padding: 18px;
        border-radius: 22px;
    }

    .home-section summary,
    .home-grid {
        padding-left: 16px;
        padding-right: 16px;
    }

    .home-grid {
        grid-template-columns: 1fr;
        padding-bottom: 16px;
    }

    .home-hero {
        padding: 18px 8px 4px;
    }
}

@media (max-width: 520px) {
    body {
        padding: 18px 12px;
        align-items: flex-start;
    }

    .container,
    .loading-box {
        width: 100%;
        padding: 20px;
        border-radius: 20px;
    }

    .page-shell {
        width: 100%;
    }

    .form-section {
        padding: 14px;
        border-radius: 14px;
    }

    .actions-area {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .action-btn,
    .download-link,
    .back-btn,
    button {
        min-height: 48px;
        padding: 13px 14px;
    }

    h1 {
        font-size: 1.5rem;
    }
}
/* CONSULTA JOGADORES - API OPS */
.apiops-result {
    margin-top: 22px;
}

.apiops-profile h2,
.apiops-table-block h3 {
    margin: 18px 0 12px;
}

.apiops-info-grid {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}

.apiops-table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 22px;
}

.apiops-table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
}

.apiops-table th,
.apiops-table td {
    padding: 10px;
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.apiops-table th {
    color: var(--text-soft);
    font-weight: 700;
}

.apiops-error {
    color: var(--danger);
}

.apiops-loading {
    color: var(--text-muted);
}

.apiops-actions {
    margin-top: 18px;
}

#resultado {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

#resultado table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
}

#resultado .accordion {
  overflow-x: auto;
}

#resultado .form-section {
  margin-top: 16px;
}

textArea {
    width: 100%;
    min-height: 50px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    outline: none;
    background: rgba(0, 0, 0, 0.35);
    color: var(--text);
    transition:
        border-color var(--transition),
        box-shadow var(--transition),
        background var(--transition),
        transform var(--transition);
}

input::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

.home-badge-logo {
    width: min(500px, 100%);
    max-width: 100%;
    height: auto;
}

.home-badge {
    max-width: 100%;
    justify-content: center;
}

.home-panel {
    width: 100%;
}

@media (max-width: 520px) {
    .home-shell {
        width: 100%;
        gap: 16px;
    }

    .home-hero {
        padding: 20px 10px 8px;
    }

    .home-badge-logo {
        width: 260px;
        height: auto;
    }

    .home-panel {
        padding: 16px;
        border-radius: 18px;
    }

    .home-section summary {
        padding: 16px;
    }

    .tool-card {
        padding: 15px;
        border-radius: 14px;
    }

    .home-footer {
        font-size: 0.8rem;
    }
}

@media (max-width: 360px) {
    .home-badge-logo {
        width: 220px;
    }
}
