/*
 * Global Stylesheet for FillFight
 * Dark mode friendly palette inspired by midnight blues and rich reds.
 */

/* Reset some basic elements */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
    background-color: #0a0d1a;
    color: #e6e6e6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: #8ab4f8;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.top-nav {
    background-color: #10182a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #1f2a40;
    position: sticky;
    top: 0;
    z-index: 10;
}

.top-nav .logo {
    display: flex;
    align-items: center;
}

.top-nav .logo-image {
    display: block;
    width: clamp(160px, 18vw, 210px);
    height: auto;
}

.top-nav .nav-links {
    list-style: none;
    display: flex;
    gap: 1rem;
}

.top-nav .nav-links a {
    color: #e6e6e6;
    font-weight: 500;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.top-nav .nav-links a:hover {
    background-color: #1f2a40;
}

.share-trigger {
    font-weight: 600;
}

main.content {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* Hero section */
.hero {
    text-align: center;
    margin-top: 2rem;
}

.hero .headline {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

/* Home Page Tiles */
.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 320px));
    gap: 1.5rem;
    margin-top: 2rem;
    justify-content: center;
}

.tile {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    padding: 0.8rem 1rem 1.1rem;
    border-radius: 16px;
    background: rgba(8, 11, 21, 0.6);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.45);
}

.tile .background {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 180px;
}

.tile .tile-label {
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    color: rgba(255,255,255,0.92);
    text-shadow: 0 2px 4px rgba(0,0,0,0.6);
    letter-spacing: 0.01em;
}

.tile .background::before,
.tile .background::after {
    content: "";
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.3s ease;
}


.tile .background::before {
    clip-path: polygon(0 0, 100% 0, 100% 100%);
    background-image: url('/assets/images/usa_flag.webp');
    z-index: 0;
}

.tile .background::after {
    clip-path: polygon(0 0, 0 100%, 100% 100%);
    z-index: 1;
}

.tile:hover .background::before,
.tile:hover .background::after {
    transform: scale(1.03);
}

.tile-blue-red .background::before {
    background-image: linear-gradient(135deg, #1b4fd6, #073079);
}

.tile-blue-red .background::after {
    background-image: linear-gradient(135deg, #d22f45, #7f152a);
}

.tile-canada-usa .background::after {
    background-image: url('/assets/images/canada_flag.webp');
}

.tile-usa-mexico .background::after {
    background-image: url('/assets/images/mexico_flag.webp');
}

/* Scoreboard */
.scoreboard {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-bottom: 1rem;
}

.scoreboard .score {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 1.2rem;
}

.scoreboard .score .label {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.scoreboard .score .value {
    font-size: 2rem;
    font-weight: 700;
}

/* Game canvas */
.canvas-container {
    border: 1px solid #1f2a40;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    width: 100%;
    background-color: #121b33;
}

#gameCanvas {
    width: 100%;
    height: auto;
    display: block;
}

/* Trash talk bar */
.trash-talk {
    background-color: #10182a;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    border-radius: 6px;
    font-style: italic;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Purchase panel */
.purchase-panel {
    background-color: #10182a;
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.purchase-alert {
    padding: 0.65rem 0.85rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.95rem;
    background: rgba(0, 123, 255, 0.15);
    color: #9fd1ff;
}

.purchase-alert[data-status="cancel"] {
    background: rgba(220, 53, 69, 0.18);
    color: #f6b0ba;
}

.share-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(4, 6, 14, 0.75);
    z-index: 900;
}

.share-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(420px, 90vw);
    background: #121b33;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
    z-index: 950;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.share-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.share-header h2 {
    margin: 0;
    font-size: 1.4rem;
}

.share-close {
    background: none;
    border: none;
    color: #e6e6e6;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.share-message {
    font-size: 1rem;
    color: #cdd5f5;
}

.share-actions {
    display: grid;
    gap: 0.75rem;
}

.share-option {
    background: linear-gradient(135deg, #1b4fd6, #8534e8);
    border: none;
    color: #fff;
    padding: 0.65rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.share-option[data-share-action="facebook"] {
    background: linear-gradient(135deg, #1877f2, #0d3a8c);
}

.share-option[data-share-action="twitter"] {
    background: linear-gradient(135deg, #1d9bf0, #0b5ea8);
}

.share-option[data-share-action="copy"] {
    background: linear-gradient(135deg, #5b6c8d, #28324d);
}

.share-option:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.share-status {
    font-size: 0.9rem;
    color: #9fd1ff;
    min-height: 1rem;
}

.share-backdrop[hidden],
.share-modal[hidden] {
    display: none;
}

.purchase-panel select,
.purchase-panel input[type="number"] {
    background-color: #0a0d1a;
    color: #e6e6e6;
    border: 1px solid #1f2a40;
    padding: 0.5rem;
    border-radius: 4px;
}

.purchase-panel button {
    background-image: linear-gradient(to right, #007bff, #dc3545);
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 0.6rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.purchase-panel button:hover {
    opacity: 0.85;
}

/* Activity feed */
.remaining-feed {
    background-color: #10182a;
    border-radius: 6px;
    margin: 1rem 0;
    padding: 0.75rem 1.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    font-weight: 600;
    min-height: 3.2rem;
    color: #ffffff;
}

.remaining-feed .team-remaining {
    text-align: center;
    font-size: 1.05rem;
}

.remaining-feed .team-remaining span {
    display: inline-block;
}

/* Rules card */
.rules-card {
    background-color: #10182a;
    border-radius: 6px;
    padding: 1rem;
    margin: 1rem 0;
    line-height: 1.4;
}

.rules-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.rules-card ol {
    list-style: decimal inside;
    margin-left: 1rem;
}

/* Footer */
.site-footer {
    background-color: #10182a;
    padding: 1rem;
    color: #a0a8c0;
    text-align: center;
    font-size: 0.85rem;
    border-top: 1px solid #1f2a40;
}

.site-footer .footer-links {
    margin-bottom: 0.5rem;
}

.site-footer .copyright-link {
    color: inherit;
    text-decoration: none;
    cursor: default;
    pointer-events: auto;
}

.site-footer .copyright-link:hover,
.site-footer .copyright-link:focus {
    color: inherit;
    text-decoration: none;
}

.site-footer .separator {
    margin: 0 0.5rem;
    color: #394867;
}

.site-footer a {
    color: #8ab4f8;
}

.site-footer .disclaimer {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #6c7698;
}