/* ----------------------------------------------------------
   GLOBAL
----------------------------------------------------------- */

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

body {
    margin: 0;
    padding: 0;
    font-family: "Inter", Arial, sans-serif;
    background: #f7f8fa;
    color: #222;
}

a {
    color: #0366d6;
}

/* ----------------------------------------------------------
   NAVBAR
----------------------------------------------------------- */

.navbar {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #e4e6eb;
}

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.logo {
    font-size: 21px;
    font-weight: 600;
    color: #111827;
    text-decoration: none;
    letter-spacing: 0.02em;
}

/* odkazy v menu */

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    font-size: 0.95rem;
}

.nav-link {
    position: relative;
    text-decoration: none;
    color: #4b5563;
    font-weight: 500;
    padding: 0.25rem 0;
    transition: color 0.15s ease;
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, #4f46e5, #22c55e);
    transition: width 0.18s ease;
}

.nav-link:hover {
    color: #111827;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.active {
    color: #111827;
}

/* pravá strana – info o uživateli / login */

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: #6b7280;
    white-space: nowrap;
}

.nav-user-name {
    font-weight: 500;
    color: #374151;
}

.nav-user-sep {
    opacity: 0.6;
}

.nav-user-link {
    color: #0366d6;
    text-decoration: none;
    font-weight: 500;
}

.nav-user-link:hover {
    text-decoration: underline;
}

/* ----------------------------------------------------------
   CONTENT WRAPPER
----------------------------------------------------------- */

.content {
    max-width: 900px;
    margin: 40px auto;
    background: #ffffff;
    padding: 35px 40px;
    border-radius: 10px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.05);
}

/* ----------------------------------------------------------
   TITLES & TEXT
----------------------------------------------------------- */

h1 {
    font-size: 28px;
    color: #1a1a1a;
    margin-bottom: 18px;
}

h2 {
    font-size: 22px;
    margin-top: 30px;
    margin-bottom: 10px;
    color: #b6e2f0;
}

h3 {
    font-size: 18px;
    margin-top: 24px;
    margin-bottom: 8px;
    color: #1f2933;
}

p {
    line-height: 1.6;
    margin: 0 0 12px 0;
    color: #343a40;
}

.intro {
    color: #444;
    line-height: 1.6;
    margin-bottom: 25px;
}

ul {
    margin-top: 0;
    margin-bottom: 12px;
    padding-left: 20px;
}

/* ----------------------------------------------------------
   HOMEPAGE BUTTONS
----------------------------------------------------------- */

.home-buttons {
    margin-top: 25px;
}

.home-buttons a {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    margin-right: 15px;
}

.btn-primary {
    background: #0366d6;
    color: white;
}

.btn-primary:hover {
    background: #024ea8;
}

.btn-secondary {
    background: #e2e8f0;
    color: #222;
}

.btn-secondary:hover {
    background: #cfd8e3;
}

/* ----------------------------------------------------------
   GENERATOR BOX (dashboard)
----------------------------------------------------------- */

.gen-box {
    background: #f0f3f7;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 25px;
    border: 1px solid #d6d9df;
}

.gen-box label {
    font-weight: 500;
}

.gen-box select,
.gen-box input {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #b8bcc3;
    margin-right: 10px;
    font-size: 15px;
    max-width: 100%;
}

/* tlačítko „Send Request“ */
button.generate {
    background: #0366d6;
    color: white;
    border: none;
    padding: 9px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}

button.generate:hover {
    background: #024ea8;
}

/* preset buttons (Sportka, Eurojackpot…) */
.preset-buttons {
    margin-bottom: 18px;
}

.preset-buttons button {
    border: 1px solid #cbd2e1;
    background: #e9edf5;
    border-radius: 6px;
    padding: 7px 14px;
    font-size: 14px;
    cursor: pointer;
    margin-right: 8px;
    margin-bottom: 6px;
}

.preset-buttons button:hover {
    background: #dde3f1;
}

/* ----------------------------------------------------------
   CODE / RESULTS (dashboard + docs)
----------------------------------------------------------- */

/* hlavní boxy s JSON / ukázkami */
.result-box {
    background: #272822;
    color: #adff2f;
    padding: 15px;
    border-radius: 6px;
    font-family: "Courier New", monospace;
    margin-top: 20px;
    white-space: pre;       /* zachová formátování */
    overflow-x: auto;       /* na mobilu lze posunout URL/JSON do strany */
}

/* obecně všechny <pre> v dokumentaci */
pre {
    background: #272822;
    color: #adff2f;
    padding: 15px;
    border-radius: 6px;
    font-family: "Courier New", monospace;
    white-space: pre;
    overflow-x: auto;       /* horizontální scroll místo useknutí */
    margin-top: 12px;
    margin-bottom: 16px;
}

/* inline kód v textu */
code {
    font-family: "Courier New", monospace;
    font-size: 0.95em;
    background: #edf2ff;
    padding: 2px 4px;
    border-radius: 3px;
    word-break: break-all;  /* kdyby se objevila dlouhá URL v <code> */
}

/* ----------------------------------------------------------
   FOOTER
----------------------------------------------------------- */

footer {
    text-align: center;
    padding: 25px;
    margin-top: 40px;
    color: #777;
    font-size: 13px;
}

/* ----------------------------------------------------------
   RESPONSIVE (MOBILE)
----------------------------------------------------------- */

@media (max-width: 768px) {
    .navbar {
        padding: 10px 14px;
    }

    .nav-right a {
        margin-left: 14px;
        font-size: 14px;
    }

    .content {
        margin: 20px 10px;
        padding: 20px 16px;
        border-radius: 8px;
    }

    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 20px;
    }

    .gen-box {
        padding: 16px;
    }

    .gen-box select,
    .gen-box input {
        width: 100%;
        margin: 4px 0 10px 0;
    }

    button.generate {
        width: 100%;
        text-align: center;
        margin-top: 10px;
    }

    .preset-buttons button {
        width: 100%;
        text-align: left;
    }

    .result-box,
    pre {
        font-size: 13px;
    }
}

/* --- DnD Dice page --- */

.page-dnd {
    min-height: calc(100vh - 120px);
    padding: 3rem 1rem 4rem;
    background: radial-gradient(circle at top, #4338ca 0%, #111827 55%, #020617 100%);
    color: #f9fafb;
}

/* Obecný text na tmavém pozadí (DnD / Tombola / Admin) */
.page-dnd p {
    color: #e5e7eb;      /* světle šedá, čitelná na #111827 */
    font-size: 0.95rem;
}

/* Speciálně uvnitř panelů (pravý sloupec Losování, apod.) */
.dnd-panel p {
    color: #e5e7eb;
    opacity: 0.95;
}

.dnd-hero {
    max-width: 1100px;
    margin: 0 auto 2.5rem;
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr);
    gap: 2rem;
    align-items: center;
}

.dnd-hero-text h1 {
    font-size: 2.4rem;
    line-height: 1.2;
    margin-bottom: 0.75rem;
    color: #f9fafb;
}

.dnd-hero-text h1 span {
    font-size: 1.1rem;
    font-weight: 400;
    color: #e5e7eb;
    opacity: 1;
}

.dnd-hero-text p {
    max-width: 34rem;
    color: #e5e7eb;
    opacity: 0.95;
}

.dnd-hero-dice {
    display: flex;
    justify-content: center;
}

.dice-orbit {
    position: relative;
    width: 220px;
    height: 220px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.dice-orbit .dice {
    position: absolute;
}

.dice-orbit .dice-d20 {
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
}

.dice-orbit .dice-d12 {
    bottom: 12%;
    left: 15%;
}

.dice-orbit .dice-d8 {
    bottom: 12%;
    right: 12%;
}

.dnd-layout {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    gap: 2rem;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr);
}

.dnd-panel {
    background: #111827;
    border-radius: 1.5rem;
    padding: 1.75rem;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(148, 163, 184, 0.5);
}

.dnd-panel h2 {
    margin-top: 0;
    margin-bottom: 1.25rem;
    font-size: 1.4rem;
    color: #f9fafb;
}

.dnd-form .form-group {
    margin-bottom: 1.1rem;
}

.dnd-form label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
    color: #e5e7eb;
}

.dnd-form select,
.dnd-form input[type="number"] {
    width: 100%;
    padding: 0.5rem 0.6rem;
    border-radius: 0.6rem;
    border: 1px solid rgba(148, 163, 184, 0.8);
    background: #020617;
    color: #f9fafb;
    outline: none;
}

.dnd-form select:focus,
.dnd-form input[type="number"]:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.7);
}

.dnd-form .hint {
    margin-top: 0.25rem;
    font-size: 0.78rem;
    color: #cbd5f5;
    opacity: 0.95;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.2rem;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.4rem;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #4f46e5, #22c55e);
    color: #f9fafb;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 25px rgba(34, 197, 94, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: none;
}

.roll-status {
    font-size: 0.85rem;
    opacity: 0.9;
    color: #e5e7eb;
}

.roll-status.error {
    color: #f97373;
}

/* Výsledky */

.result-summary {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.2rem;
    gap: 0.25rem;
}

.result-label {
    font-size: 0.9rem;
    color: #e5e7eb;
    opacity: 0.85;
}

.result-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #f9fafb;
}

.dice-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
    margin-top: 0.5rem;
}

.dice {
    width: 56px;
    height: 56px;
    border-radius: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    background: linear-gradient(145deg, #22c55e, #16a34a);
    box-shadow:
        0 10px 20px rgba(34, 197, 94, 0.4),
        inset 0 0 0 1px rgba(15, 23, 42, 0.8);
    position: relative;
}

.dice span.dice-face {
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.9);
}

/* Lehce jiné barvy podle typu kostky (jen estetika) */

.dice-d20 {
    background: linear-gradient(145deg, #6366f1, #4f46e5);
    box-shadow:
        0 10px 20px rgba(79, 70, 229, 0.5),
        inset 0 0 0 1px rgba(15, 23, 42, 0.9);
}

.dice-d12 {
    background: linear-gradient(145deg, #f97316, #ea580c);
}

.dice-d8 {
    background: linear-gradient(145deg, #ec4899, #db2777);
}

/* Kostka, která se nepočítá (u adv/dis) */

.dice-discarded {
    opacity: 0.45;
    filter: grayscale(0.6);
}

/* Součet */

.result-total {
    font-size: 1rem;
    font-weight: 500;
    margin-top: 0.25rem;
    color: #f9fafb;
}

.result-extra details {
    margin-top: 1.1rem;
    font-size: 0.85rem;
    color: #e5e7eb;
}

.code-block {
    margin-top: 0.5rem;
    padding: 0.6rem 0.8rem;
    border-radius: 0.6rem;
    background: #020617;
    border: 1px solid rgba(148, 163, 184, 0.7);
    max-height: 260px;
    overflow: auto;
    font-size: 0.78rem;
    color: #e5e7eb;
}

.page-dnd .endpoint-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: #020617;
    color: #e5e7eb;
    border: 1px solid rgba(148, 163, 184, 0.8);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
        "Liberation Mono", "Courier New", monospace;
    font-size: 0.8rem;
}

/* Responsivita */

@media (max-width: 900px) {
    .dnd-hero {
        grid-template-columns: minmax(0, 1fr);
        text-align: left;
    }

    .dnd-hero-dice {
        order: -1;
    }

    .dnd-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Nápověda – lepší kontrast */

.page-dnd details > summary {
    color: #f9fafb;
    font-size: 0.9rem;
    cursor: pointer;
}

.page-dnd .help-details {
    margin-top: 1.2rem;
}

.page-dnd .help-lang-switch {
    margin-top: 0.6rem;
    margin-bottom: 0.8rem;
    display: inline-flex;
    gap: 0.4rem;
}

.page-dnd .help-lang-btn {
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.9);
    background: #020617;
    color: #f9fafb;
    font-size: 0.8rem;
    cursor: pointer;
}

.page-dnd .help-lang-btn.active {
    background: linear-gradient(135deg, #4f46e5, #22c55e);
    border-color: transparent;
    color: #f9fafb;
}

.page-dnd .help-text h3 {
    margin-top: 0.7rem;
    margin-bottom: 0.3rem;
    font-size: 0.95rem;
    color: #f9fafb;
}

.page-dnd .help-text ul {
    margin: 0 0 0.5rem 1.1rem;
    padding: 0;
    font-size: 0.86rem;
    color: #e5e7eb;
}

.page-dnd .help-text li {
    margin-bottom: 0.1rem;
}

/* Tombola – přehled losování */

.tombola-history {
    max-width: 1100px;
    margin: 2.5rem auto 0;
}

.tombola-history h2 {
    margin: 0 0 1rem;
    font-size: 1.4rem;
    color: #f9fafb;          /* stejná bílá jako zbytek stránky */
}

.tombola-history .card {
    background: #020617;
    border-radius: 1.5rem;
    padding: 1.5rem;
    border: 1px solid rgba(148, 163, 184, 0.6);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.65);
}

.tombola-history p {
    color: #e5e7eb;
}

/* tabulka losování */

.tombola-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #e5e7eb;
}

.tombola-table th,
.tombola-table td {
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid rgba(55, 65, 81, 0.8);
}

.tombola-table th {
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #9ca3af;
}

.tombola-table tr:hover td {
    background: rgba(31, 41, 55, 0.6);
}

.btn-small {
    padding: 0.25rem 0.7rem;
    font-size: 0.8rem;
}

.badge-muted {
    display: inline-block;
    padding: 0.1rem 0.6rem;
    border-radius: 999px;
    background: #111827;
    color: #9ca3af;
    font-size: 0.75rem;
}

/* Tombola – nadpisy a texty v přehledu losování */

.page-dnd h2,
.page-dnd h3 {
    color: #f9fafb !important;
}

.tombola-history h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.4rem;
    color: #f9fafb !important;
}

.tombola-history p {
    color: #e5e7eb;
}

.nav-user {
    margin-left: 1rem;
    font-size: 0.9rem;
    opacity: 0.85;
}
.nav-user a {
    text-decoration: underline;
}

/* Admin – správa uživatelů */
.page-dnd .admin-users {
    max-width: 1100px;
    margin: 2.5rem auto;
}

.page-dnd .admin-users h1 {
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    color: #f9fafb;
}

.page-dnd .admin-users h2 {
    font-size: 1.3rem;
    color: #f9fafb;
    margin-bottom: 1rem;
}

/* Admin poznámka pod nadpisem */
.admin-users .admin-note {
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    color: #e5e7eb;            /* světle šedá, dobře čitelná */
    opacity: 0.9;
}

/* Světlé nadpisy na tmavých DnD / tombola stránkách */
.page-dnd h1 {
    color: #c4dd88;
}

/* 32 karet – mřížka sejmutých karet */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)); /* 4 sloupce */
    gap: 0.35rem 0.75rem;
    font-size: 0.95rem;
}

.cards-grid-item {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    margin: 0.2rem 0;
}

/* číslo – menší, decentní */
.cards-grid-index {
    font-size: 0.75rem;       /* menší než běžný text */
    color: #9ca3af;           /* světle šedá */
    opacity: 0.8;
}

/* karta – větší, výrazná */
.cards-grid-value {
    font-size: 1.35rem;       /* větší než běžný text */
    font-weight: 600;
    color: #f9fafb;           /* skoro bílá */
}
/* Na mobilu raději 2 sloupce */
@media (max-width: 768px) {
    .cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Disabled tlačítka – lehce vybledlá a neklikací */
.btn-primary[disabled],
.btn-secondary[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

/* Obecné tlačítko – sekundární styl (modrofialový) */
button.btn-secondary,
input[type="submit"].btn-secondary,
a.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.3rem;
    border-radius: 999px;
    border: none;
    font-size: 0.95rem;
    font-weight: 500;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6); /* modrá → fialová */
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(56, 189, 248, 0.35);
    transition:
        transform 0.12s ease,
        box-shadow 0.12s ease,
        opacity 0.12s ease,
        background 0.12s ease;
}

button.btn-secondary:hover:not(:disabled),
input[type="submit"].btn-secondary:hover:not(:disabled),
a.btn-secondary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(56, 189, 248, 0.45);
    opacity: 0.97;
}

button.btn-secondary:active:not(:disabled),
input[type="submit"].btn-secondary:active:not(:disabled),
a.btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 6px 18px rgba(56, 189, 248, 0.35);
}

button.btn-secondary:disabled,
input[type="submit"].btn-secondary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

/* === NAVBAR DROPDOWN === */

.nav-dropdown {
    position: relative;
}

.nav-dropdown > .nav-link {
    cursor: pointer;
    user-select: none;
}

.nav-dropdown-menu {
    position: absolute;
    top: 150%;
    left: 0;
    min-width: 180px;
    padding: 0.6rem 0;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid #e5e7eb;
    border-radius: 0.6rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.15s ease;
    z-index: 9999;
}

.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown-item {
    display: block;
    padding: 0.45rem 1rem;
    color: #4b5563;
    text-decoration: none;
    font-size: 0.92rem;
    transition: background 0.15s ease;
}

.nav-dropdown-item:hover {
    background: #f3f4f6;
    color: #111827;
}

.nav-dropdown-item.active {
    font-weight: 600;
    color: #1f2937;
}

/* === 52 karet – mřížka sejmutých karet === */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));  /* 4 sloupce */
    gap: 0.35rem 1rem;       /* vertikální x horizontální mezery */
    margin-top: 0.75rem;
}

.cards-grid-item {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    padding: 0.15rem 0;
}

/* pořadové číslo (#) – menší, decentní */
.cards-grid-index {
    font-size: 0.8rem;
    opacity: 0.7;
    min-width: 1.2rem;       /* sjednotí šířku čísla */
    text-align: right;
}

/* karta – zvýrazněná */
.cards-grid-value {
    font-size: 1.3rem;
    font-weight: 600;
    color: #f9fafb;
    letter-spacing: 0.02em;
}

/* Mobilní layout – 2 sloupce */
@media (max-width: 768px) {
    .cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

