@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700;800;900&family=Roboto:wght@400;500;700&display=swap');

:root {
    --bg: #101522;
    --panel: #161616;
    --panel-light: #3f1b00;
    --orange: #ea6700;
    --blue: #19b5e5;
    --green: #269e5d;
    --red: #9e2626;
    --yellow: #d49a27;
    --gray: #596477;
    --white: #ffffff;
    --muted: #aab6ca;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 15% 10%, #000000 0, transparent 40%),
        radial-gradient(ellipse at 85% 80%, #461e00 0, transparent 35%),
        var(--bg);
    color: var(--white);
    font-family: 'Roboto', sans-serif;
}

button, input {
    font: inherit;
}

button {
    cursor: pointer;
}

.game {
    max-width: 1450px;
    width: 94%;
    margin: auto;
    padding: 25px 0;
}

.header {
    text-align: center;
    padding: 20px 0 30px;
}

.logo {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 900;
    font-size: clamp(38px, 7vw, 70px);
    letter-spacing: 2px;
    text-shadow: 0 5px 25px #0008;
}

.logo span {
    color: var(--orange);
}

.header p {
    color: var(--muted);
    margin-top: 4px;
}

.mode-selector {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 35px;
}

.mode {
    background: var(--panel);
    color: white;
    border: 1px solid #43516a;
    border-radius: 9px;
    padding: 13px 32px;
    font-weight: 800;
    letter-spacing: 1px;
    transition: .25s ease;
}

.mode:hover {
    transform: translateY(-3px);
    border-color: var(--orange);
}

.mode.active {
    background: var(--orange);
    color: #161616;
    border-color: var(--orange);
    box-shadow: 0 5px 20px #f99e1a55;
}

.game-intro {
    text-align: center;
    margin-bottom: 30px;
}

.game-intro h1 {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: clamp(32px, 5vw, 48px);
    margin: 0 0 5px;
    text-transform: uppercase;
}

.game-intro p,
.date {
    color: var(--muted);
}

.date {
    font-size: 12px;
    margin-top: 10px;
}

.guess-section {
    max-width: 700px;
    margin: auto;
}

.search-box {
    display: flex;
    gap: 10px;
}

.search-box input {
    flex: 1;
    min-width: 0;
    background: var(--panel);
    border: 1px solid #43516a;
    border-radius: 9px;
    padding: 16px;
    color: white;
    outline: none;
}

.search-box input:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px #f99e1a22;
}

.search-box button,
#nextRoundButton {
    border: 0;
    background: var(--orange);
    color: #171717;
    border-radius: 9px;
    padding: 0 28px;
    font-weight: 900;
    transition: .2s;
}

.search-box button:hover,
#nextRoundButton:hover {
    transform: scale(1.04);
    box-shadow: 0 5px 20px #f99e1a66;
}

.search-box button:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.message {
    min-height: 25px;
    text-align: center;
    margin: 17px 0;
    color: var(--muted);
}

.message.error {
    color: #ff7777;
}

.legend {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 12px;
    color: var(--muted);
    margin: 25px 0;
}

.legend div {
    display: flex;
    align-items: center;
    gap: 7px;
}

.legend-color {
    width: 11px;
    height: 11px;
    border-radius: 3px;
}

.green { background: var(--green); }
.red { background: var(--red); }
.yellow { background: var(--yellow); }
.gray { background: var(--gray); }

.results-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 35px 0 12px;
}

.results-heading h2 {
    font-family: 'Barlow Condensed', sans-serif;
    letter-spacing: 2px;
}

#attemptCount {
    color: var(--muted);
    font-size: 13px;
}

.table-scroll {
    overflow-x: auto;
    padding-bottom: 10px;
}

#resultsTable {
    width: 100%;
    min-width: 950px;
    border-spacing: 5px;
    table-layout: fixed;
}

#resultsTable th {
    font-size: 11px;
    color: var(--muted);
    padding: 10px 3px;
}

#resultsTable th:first-child {
    width: 110px;
}

#resultsTable td {
    padding: 0;
    text-align: center;
}

.hero-name {
    font-weight: 800;
    text-align: left;
    padding: 10px !important;
    color: white;
}

.tile {
    min-height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    overflow-wrap: anywhere;
    color: white;
    transform-style: preserve-3d;
    backface-visibility: hidden;
}

.tile.correct { background: var(--green); }
.tile.near { background: var(--yellow); }
.tile.wrong { background: var(--red); }

.tile.reveal {
    animation: reveal .65s cubic-bezier(.2,.8,.2,1) both;
}

@keyframes reveal {
    0% {
        transform: rotateY(90deg) scale(.85);
        opacity: 0;
    }
    55% {
        transform: rotateY(-12deg) scale(1.04);
        opacity: 1;
    }
    100% {
        transform: rotateY(0) scale(1);
        opacity: 1;
    }
}

.new-row {
    animation: slideIn .55s ease both;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.victory {
    position: relative;
    margin: 30px auto;
    padding: 35px 20px;
    text-align: center;
    overflow: hidden;
    border-radius: 16px;
    background: linear-gradient(120deg, #1d754b, #164c70, #714e20);
    animation: victoryEnter .8s cubic-bezier(.2,.8,.2,1);
}

.victory[hidden] {
    display: none;
}

.victory::before {
    content: "✦";
    position: absolute;
    font-size: 220px;
    color: #ffffff12;
    left: 10%;
    top: -75px;
    animation: rotate 15s linear infinite;
}

@keyframes rotate {
    to { transform: rotate(360deg); }
}

@keyframes victoryEnter {
    from { opacity: 0; transform: scale(.8); }
    to { opacity: 1; transform: scale(1); }
}

.victory-icon {
    font-size: 55px;
    animation: bounce 1s infinite alternate;
}

@keyframes bounce {
    to { transform: translateY(-10px) rotate(5deg); }
}

.victory h2 {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 45px;
    margin: 8px;
}

.victory p {
    color: #ffffffdd;
}

#nextRoundButton {
    padding: 14px 25px;
    margin-top: 12px;
}

.game-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin: 30px 0;
    padding: 18px;
    background: var(--panel);
    border-radius: 12px;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat span {
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 1px;
}

.stat strong {
    font-size: 18px;
}

.reset-button {
    border: 1px solid #526078;
    background: transparent;
    color: white;
    padding: 10px 14px;
    border-radius: 7px;
}

.reset-button:hover {
    border-color: var(--orange);
    color: var(--orange);
}

footer {
    text-align: center;
    padding: 25px;
    color: #758198;
    font-size: 11px;
    letter-spacing: 2px;
}

/* Tablet */
@media (max-width: 900px) {
    .game {
        width: 96%;
    }

    #resultsTable {
        min-width: 850px;
    }

    .tile {
        min-height: 58px;
        font-size: 11px;
    }
}

/* Smartphone */
@media (max-width: 600px) {
    .game {
        width: 96%;
        padding-top: 10px;
    }

    .header {
        padding: 20px 0;
    }

    .mode-selector {
        gap: 8px;
        margin-bottom: 25px;
    }

    .mode {
        flex: 1;
        padding: 12px 5px;
        font-size: 12px;
    }

    .search-box {
        flex-direction: column;
    }

    .search-box input {
        padding: 15px;
    }

    .search-box button {
        padding: 15px;
    }

    .legend {
        gap: 10px;
        font-size: 10px;
    }

    .results-heading {
        margin-top: 25px;
    }

    #resultsTable {
        min-width: 820px;
    }

    .tile {
        min-height: 55px;
    }

    .game-footer {
        flex-wrap: wrap;
    }

    .reset-button {
        width: 100%;
    }
}

/* Reduzierte Animationen für entsprechende Systemeinstellung */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* Eigene Held-Vorschlagsliste */

.hero-search-wrapper {
    position: relative;
    flex: 1;
    min-width: 0;
}

.hero-search-wrapper input {
    width: 100%;
}

.hero-suggestions {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #1b2435;
    border: 1px solid #394761;
    border-radius: 8px;
    max-height: 240px;
    overflow-y: auto;
    z-index: 9999;
    box-shadow: 0 8px 20px rgba(0,0,0,.4);
}

.hero-suggestions.show {
    display: block;
}

.hero-suggestion {
    padding: 12px 15px;
    color: white;
    cursor: pointer;
    border-bottom: 1px solid #303b50;
    transition: background .15s ease;
}

.hero-suggestion:last-child {
    border-bottom: none;
}

.hero-suggestion:hover,
.hero-suggestion:active {
    background: #34445f;
}

/* Smartphone */
@media (max-width: 600px) {
    .search-box {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-search-wrapper {
        width: 100%;
    }

    .hero-suggestions {
        max-height: 220px;
    }

    .hero-suggestion {
        padding: 15px;
        font-size: 16px;
    }

    #guessButton {
        width: 100%;
    }
}

/* Heldenbilder in der Ergebnistabelle */



.hero-name img {
    display: block;
    width: 70px !important;
    height: 70px !important;
    min-width: 70px;
    max-width: 70px;
    object-fit: contain;
    flex-shrink: 0;
}

.hero-name span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Große transparente Richtungspfeile */

.tile {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.tile.arrow-up::before,
.tile.arrow-down::before {
    position: absolute;
    z-index: -1;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 75px;
    font-weight: 900;
    color: rgba(0, 0, 0, 0.527);
    line-height: 1;
    pointer-events: none;
}

.tile.arrow-up::before {
    content: "▲";
}

.tile.arrow-down::before {
    content: "▼";
}