:root {
    --bg-deep: #140904;
    --bg-mid: #291109;
    --orange: #ff7a18;
    --orange-light: #ffb067;
    --soft: rgba(255, 122, 24, 0.08);
    --line: rgba(255, 122, 24, 0.24);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(1200px 700px at 8% -5%, rgba(255, 122, 24, 0.22), transparent 55%),
        radial-gradient(1200px 700px at 100% 105%, rgba(255, 180, 120, 0.18), transparent 58%),
        linear-gradient(160deg, var(--bg-deep), var(--bg-mid));
    font-family: sans-serif;
    color: #ffffff;
}

button,
input {
    font: inherit;
}

/* Navigation Bar */
.navbar {
    display: flex;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(20, 9, 4, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 122, 24, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-links a {
    color: #fff;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.3s ease, transform 0.3s ease;
}

.nav-links a:hover {
    color: rgba(255, 122, 24, 1);
    transform: translateY(-2px);
}

/* Base Page Template Styles */
.page-header {
    text-align: center;
    margin-top: 4rem;
    margin-bottom: 2rem;
}

.page-title {
    font-size: clamp(3rem, 6vw, 6rem);
    color: #fff;
    margin-bottom: 1rem;
}

.page-content {
    max-width: 1200px;
    margin: 0 auto 4rem;
    padding: 2rem;
    background: rgba(255, 122, 24, 0.05);
    border: 1px solid rgba(255, 122, 24, 0.2);
    border-radius: 16px;
    min-height: 50vh;
}

.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 3rem;
    padding: 0 1rem;
    animation: fadeUp 0.7s ease both;
}

.profile-pic {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg-mid);
    outline: 4px solid rgba(255, 122, 24, 0.5);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    animation: float 4s ease-in-out infinite;
}

h1 {
    color: rgb(255, 255, 255);
    text-align: center;
    margin-top: 1rem;
    font-size: clamp(5rem, 10vw, 10rem);
    font-family: sans-serif;
}

.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 2rem;
    max-width: 1200px;
    margin: 3rem auto;
}

.card {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 122, 24, 0.05);
    border: 1px solid rgba(255, 122, 24, 0.2);
    border-radius: 16px;
    padding: 3.5rem 2rem;
    text-decoration: none;
    color: #fff;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    font-family: sans-serif;
}

.card:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 122, 24, 0.6);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    background: rgba(255, 122, 24, 0.1);
}

.card h2 {
    font-size: 2.2rem;
    letter-spacing: 1px;
}

.page-intro {
    max-width: 620px;
    margin: 1rem auto 0;
    color: #ffc89c;
    text-align: center;
    font-size: 1.15rem;
    line-height: 1.6;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.8rem;
    padding: 0.8rem 1.3rem;
    border: 1px solid rgba(255, 122, 24, 0.45);
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 122, 24, 0.24);
}

.button.primary {
    background: linear-gradient(135deg, #ff7a18, #ff9b3d);
}

.button.secondary {
    background: rgba(255, 122, 24, 0.08);
}

.button.compact {
    min-height: 2.3rem;
    padding: 0.55rem 1rem;
}

/* Games */
.game-page {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.game-selector {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.game-tab {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem;
    border: 1px solid rgba(255, 122, 24, 0.28);
    border-radius: 12px;
    background: rgba(20, 9, 4, 0.45);
    color: #fff;
    cursor: pointer;
    text-align: left;
    transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.game-tab:hover,
.game-tab.active {
    transform: translateY(-3px);
    border-color: rgba(255, 122, 24, 0.75);
    background: rgba(255, 122, 24, 0.14);
}

.game-tab span {
    font-weight: bold;
    font-size: 1.1rem;
}

.game-tab small {
    color: #ffc89c;
}

.arcade-shell {
    overflow: hidden;
    border: 1px solid rgba(255, 122, 24, 0.3);
    border-radius: 16px;
    background: rgba(20, 9, 4, 0.55);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.game-toolbar,
.game-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
}

.game-toolbar {
    border-bottom: 1px solid rgba(255, 122, 24, 0.2);
}

.game-toolbar .eyebrow {
    color: var(--orange-light);
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.game-toolbar h2 {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.game-stats {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.game-stats span {
    padding: 0.45rem 0.7rem;
    border: 1px solid rgba(255, 122, 24, 0.25);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.22);
    color: #ffc89c;
    font-weight: bold;
}

.game-stats strong {
    color: #fff;
}

.canvas-wrap {
    position: relative;
    background: rgba(0, 0, 0, 0.35);
}

#gameCanvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 900 / 520;
    cursor: crosshair;
    touch-action: none;
}

.game-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(20, 9, 4, 0.72);
    text-align: center;
}

.game-overlay.hidden {
    display: none;
}

.game-overlay h3 {
    font-size: clamp(2rem, 6vw, 4rem);
}

.game-overlay p,
.game-footer {
    color: #ffc89c;
}

.game-overlay p {
    max-width: 480px;
    line-height: 1.5;
}

.game-footer {
    border-top: 1px solid rgba(255, 122, 24, 0.2);
}

/* Page switch animation */
.page-transition {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    overflow: hidden;
    pointer-events: none;
    transform: translateX(-105%) skewX(-7deg);
    transform-origin: left center;
    background:
        radial-gradient(circle at 35% 45%, rgba(255, 255, 255, 0.3), transparent 18%),
        linear-gradient(135deg, #ff6a00, #ff9b3d 46%, #2a1007);
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.4);
}

.page-switching .page-transition {
    animation: pageWipe 0.48s cubic-bezier(0.7, 0, 0.2, 1) forwards;
}

.transition-fish {
    position: relative;
    width: 86px;
    height: 48px;
    transform: skewX(7deg);
    border-radius: 50%;
    background: #fff4ea;
    box-shadow: 0 0 35px rgba(255, 255, 255, 0.45);
    animation: fishDash 0.48s ease forwards;
}

.transition-fish::before {
    content: "";
    position: absolute;
    left: -28px;
    top: 8px;
    border-top: 16px solid transparent;
    border-bottom: 16px solid transparent;
    border-right: 34px solid #fff4ea;
}

.transition-fish::after {
    content: "";
    position: absolute;
    right: 16px;
    top: 13px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #140904;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes pageWipe {
    0% {
        transform: translateX(-105%) skewX(-7deg);
    }
    62% {
        transform: translateX(0) skewX(-7deg);
    }
    100% {
        transform: translateX(0) skewX(-7deg);
    }
}

@keyframes fishDash {
    0% {
        opacity: 0;
        transform: translateX(-90px) skewX(7deg) scale(0.78);
    }
    35% {
        opacity: 1;
    }
    100% {
        opacity: 1;
        transform: translateX(38px) skewX(7deg) scale(1);
    }
}

/* AI Chat UI */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 60vh;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(20, 9, 4, 0.4);
}

.chat-box {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-message {
    max-width: 80%;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    line-height: 1.5;
    font-size: 1.1rem;
    word-wrap: break-word;
}

.chat-message.user {
    align-self: flex-end;
    background: rgba(255, 122, 24, 0.2);
    border: 1px solid rgba(255, 122, 24, 0.4);
    border-bottom-right-radius: 2px;
}

.chat-message.ai {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom-left-radius: 2px;
}

.chat-input-wrapper {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 122, 24, 0.2);
}

#ai-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border-radius: 99px;
    border: 1px solid rgba(255, 122, 24, 0.3);
    background: rgba(20, 9, 4, 0.6);
    color: #fff;
    font-size: 1.1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.3s ease;
}

#ai-input:focus {
    border-color: rgba(255, 122, 24, 0.8);
}

#ai-send {
    padding: 0 2rem;
    border-radius: 99px;
    border: none;
    background: linear-gradient(135deg, #ff7a18, #ff9b3d);
    color: #fff;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#ai-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 122, 24, 0.3);
}

#ai-send:active {
    transform: translateY(0);
}
