/* CSS Document */

body {
    background: radial-gradient(circle at top, #2b2b2b, #0f0f0f);
    color: #e6e6e6;
    font-family: "Georgia", serif;
}

/* =========================
   NAV
   ========================= */

.mansion-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 1rem 2rem;
    background: #111;
    border-bottom: 1px solid #2a2a2a;
}

/* Brand */
.mansion-nav .brand {
    font-family: "Georgia", serif;
    font-size: 1.4rem;
    letter-spacing: 1px;
    color: #e6e6e6;
    text-decoration: none;
}

.mansion-nav .brand:hover {
    color: #cfcfcf;
}

/* Nav links */
.nav-links {
    list-style: none;
    display: flex;
    gap: 1rem;
    padding: 0;
    margin: 0;
}

.nav-links a {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    text-decoration: none;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    color: #bdbdbd;
    border-radius: 6px;
    transition: 
        background 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease;
}

/* Hover = tydligt klickbar */
.nav-links a:hover {
    color: #ffffff;
    background: rgba(139, 0, 0, 0.25);
    box-shadow: 0 0 6px rgba(139, 0, 0, 0.4);
}

/* Aktiv sida */
.nav-links a.active {
    color: #ffffff;
    background: rgba(139, 0, 0, 0.45);
    box-shadow: 0 0 10px rgba(139, 0, 0, 0.6);
    cursor: default;
}


/* =========================
   HERO
   ========================= */

.hero {
    padding: 4rem 2rem;
    background: linear-gradient(180deg, #1c1c1c, #121212);
    border-radius: 12px;
    box-shadow: 0 0 40px rgba(0,0,0,0.8);
}

.hero h1 {
    font-size: 3rem;
    letter-spacing: 1px;
}

.content {
    margin-top: 3rem;
}

/* =========================
   BUTTONS
   ========================= */

.btn-accent {
    background: #8b0000;
    color: #fff;
    border: none;
}

.btn-accent:hover {
    background: #a40000;
}

/* =========================
   SYMBOLS
   ========================= */

.symbol {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #000;
    font-weight: bold;
    color: #000;
    background: #fff;
}

.red    { background: #ff4d4d; }
.blue   { background: #4d79ff; }
.green  { background: #4dff88; }
.yellow { background: #ffe066; }
.white  { background: #ffffff; }
.purple { background: #b266ff; }

/* =========================
   VICTORY
   ========================= */

.victory {
    border: 4px solid #28a745;
    box-shadow: 0 0 14px rgba(40,167,69,0.9);
}

/* =========================
   LANDING PAGE
   ========================= */

body.landing-page {
    background: radial-gradient(circle at top, #2b2b2b, #0f0f0f);
    color: #e6e6e6;
}

/* =========================
   GAME PAGE (FIXAD)
   ========================= */

body.game-page {
    background: #111;
    color: #e6e6e6; /* 🔑 FIX – var #111 */
}

/* =========================
   GAME WRAPPER (SPELET)
   ========================= */

.game-wrapper {
    max-width: 1100px;
    margin: 0 auto 3rem auto;
    background: #f4f4f4;
    color: #111;
    padding: 2rem;
    border-radius: 14px;
    box-shadow: 0 0 40px rgba(0,0,0,0.8);
}

/* Force readable Bootstrap */
.game-wrapper table,
.game-wrapper th,
.game-wrapper td,
.game-wrapper label,
.game-wrapper p,
.game-wrapper h1,
.game-wrapper h2,
.game-wrapper h3 {
    color: #111 !important;
}

.game-wrapper .form-control {
    background: #fff;
    color: #000;
}

/* =========================
   GUESS HISTORY TABLE FIX
   ========================= */

.game-wrapper table {
    background: #ffffff;
    border-collapse: collapse;
}

.game-wrapper thead th {
    background: #e9e9e9;
    color: #111;
}

.game-wrapper tbody td {
    background: #ffffff;
    color: #111;
    vertical-align: middle;
}

.game-wrapper tbody tr:nth-child(even) td {
    background: #f5f5f5;
}

.game-wrapper table,
.game-wrapper th,
.game-wrapper td {
    background-clip: padding-box;
}

/* =========================
   CONTENT UNDER GAME (NY)
   ========================= */

.game-content {
    max-width: 1100px;
    margin: 0 auto;
    color: #e6e6e6;
}

.game-content h2,
.game-content h3 {
    color: #f0e6d2;
}

.game-content p,
.game-content li {
    color: #d8d8d8;
}

/* =========================
   MANSION HEADER
   ========================= */

.mansion-header {
    position: relative;
    width: 100%;
    height: clamp(120px, 22vh, 260px);
    background-image: url("../images/header.png");
    background-size: cover;
    background-position: center 40%;
    background-repeat: no-repeat;
}

.mansion-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            to bottom,
            rgba(10,10,10,0.45),
            rgba(10,10,10,0.85)
        );
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: clamp(1rem, 5vw, 3rem);
}


.mansion-header h1 {
    margin: 0;
    font-size: clamp(1.4rem, 3.5vw, 2.6rem);
    color: #e7dcc4;
    letter-spacing: 0.08em;
    text-shadow: 0 2px 6px rgba(0,0,0,0.9);
}

.mansion-subtitle {
    font-size: clamp(0.75rem, 2vw, 1rem);
    color: #bfb39a;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-top: 0.3rem;
}

/* =========================
   FOOTER
   ========================= */


footer {
    background: #0b0b0b;              /* behåll mörk footer */
    color: #cfcfcf;                   /* ljusare, läsbar text */
    font-size: 0.9rem;
	padding-bottom: 5rem; 			  /* extra luft så inget täcks */
}

footer a {
    color: #d9b36c;                   /* accentfärg som passar mansion */
    text-decoration: none;
}

footer a:hover {
    color: #f0d58a;
    text-decoration: underline;
}

footer small,
footer p {
    color: #cfcfcf;
}


/* =========================
   MOBILE
   ========================= */
   
@media (max-width: 768px) {
    footer {
        padding-bottom: 7rem;
    }
	
    .mansion-nav {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .nav-links {
        gap: 0.5rem;
    }	
}


@media (max-width: 600px) {
    .mansion-header {
        height: 110px;
    }

    .mansion-overlay {
        padding-left: 1rem;
    }

    .mansion-subtitle {
        display: none;
    }
}

/* ===== Mobile Guess Layout – FINAL FIX ===== */
@media (max-width: 576px) {

    /* Remove table header influence */
    table thead {
        display: none;
    }

    table,
    tbody {
        display: block;
        width: 100%;
    }

    /* Each guess becomes a card */
    .guess-row {
        display: block;
        padding: 0.75rem;
        margin-bottom: 0.9rem;
        border: 1px solid #333;
        border-radius: 10px;
        background: rgba(0,0,0,0.35);
    }

    /* Guess symbols row */
    .guess-cells {
        display: flex;
        justify-content: center;
        gap: 0.4rem;
        padding-bottom: 0.4rem;
    }

    /* CP / CC rows */
    .cp-cell,
    .cc-cell {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        margin-top: 0.2rem;
    }

    .cp-cell::before {
        content: "Correct Place:";
        font-weight: bold;
        min-width: 8rem;
    }

    .cc-cell::before {
        content: "Correct Symbol:";
        font-weight: bold;
        min-width: 8rem;
    }

    /* Action row */
    .save-cell {
        margin-top: 0.5rem;
        text-align: center;
    }

    /* Index column irrelevant on mobile */
    .guess-row td:first-child {
        display: none;
    }

    /* Prevent table layout from collapsing content */
    .guess-row td {
        display: block;
        width: 100%;
    }
}
