:root {
    --bg-color: #0a0f0d;
    --table-green: #1a3c2f;
    --felt-texture: radial-gradient(circle, #255241 0%, #1a3c2f 100%);
    --accent-gold: #d4af37;
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --card-bg: #fdfdfd;
    --card-red: #e74c3c;
    --card-black: #2c3e50;

    --shadow-soft: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-heavy: 0 10px 20px rgba(0, 0, 0, 0.5);
}

body {
    margin: 0;
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    overflow-x: hidden;
}

h1,
h2,
h3 {
    font-family: 'Playfair Display', serif;
}

.gold-text {
    color: var(--accent-gold);
}

.view {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: opacity 0.3s ease;
}

.view.hidden {
    display: none;
    opacity: 0;
}

/* Main Menu */
#main-menu {
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, #0a0f0d 0%, #111 100%);
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.menu-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 3rem 0;
    width: 100%;
    max-width: 300px;
}

button {
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.primary-btn {
    background: var(--accent-gold);
    color: #000;
    font-weight: 700;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    box-shadow: var(--shadow-soft);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-heavy);
    background: #e5bd43;
}

.secondary-btn {
    background: transparent;
    border: 2px solid var(--accent-gold);
    color: var(--accent-gold);
    padding: 0.9rem 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
}

.secondary-btn:hover {
    background: rgba(212, 175, 55, 0.1);
}

.text-btn {
    background: transparent;
    color: var(--text-secondary);
    text-decoration: underline;
}

/* Game View */
#game-view {
    background: var(--felt-texture);
}

.game-header {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
}

.stats-bar {
    display: flex;
    gap: 1.5rem;
}

.stat-box {
    text-align: center;
    display: flex;
    flex-direction: column;
}

.stat-box .label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.stat-box .value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-gold);
}

.table-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2rem;
    position: relative;
    min-height: 400px;
}

.hand-area {
    display: flex;
    justify-content: center;
    gap: -30px;
    /* Overlap cards */
    min-height: 120px;
    perspective: 1000px;
}

.center-info {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(0, 0, 0, 0.6);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    pointer-events: none;
}

.controls-area {
    padding: 2rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.2);
}

.action-btn {
    padding: 1rem 1.5rem;
    border-radius: 50px;
    font-weight: 700;
    min-width: 100px;
    background: #fff;
    color: #333;
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-btn.primary {
    background: var(--accent-gold);
    color: #000;
}

/* Card Styling */
.card {
    width: 80px;
    height: 120px;
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 5px;
    margin-right: -40px;
    /* Overlap */
    position: relative;
    transition: transform 0.3s ease;
    user-select: none;
}

.card:hover {
    transform: translateY(-10px);
    z-index: 10;
}

.card.red {
    color: var(--card-red);
}

.card.black {
    color: var(--card-black);
}

.card-top,
.card-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 1rem;
    font-weight: bold;
    line-height: 1;
}

.card-bottom {
    transform: rotate(180deg);
}

.card-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
}

/* Tutorial Overlay */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
}

@media (max-width: 600px) {
    .hand-area {
        min-height: 100px;
    }

    .card {
        width: 60px;
        height: 90px;
        margin-right: -30px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .controls-area {
        padding: 1rem;
        gap: 0.5rem;
    }
}

/* Tutorial Styles */
.tutorial-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.slide {
    display: none;
    animation: fadeIn 0.5s ease;
}

.slide.active {
    display: block;
}

.slide h3 {
    color: var(--accent-gold);
    font-size: 2rem;
    margin-bottom: 1rem;
}

.slide p {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.value-list {
    list-style: none;
    padding: 0;
    font-size: 1.5rem;
    text-align: left;
    display: inline-block;
}

.value-list li {
    margin: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 5px;
}

.formula {
    background: rgba(212, 175, 55, 0.2);
    padding: 1rem;
    border-radius: 8px;
    font-family: monospace;
    font-size: 1.5rem;
    margin: 2rem 0;
    border: 1px solid var(--accent-gold);
}

.tutorial-controls {
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.2);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}



/* Dynamic Table Glows */
.table-area {
    transition: box-shadow 0.5s ease;
    border-radius: 20px;
    /* For the glow */
}

.table-area.force-hot {
    box-shadow: var(--glow-hot);
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.table-area.force-cold {
    box-shadow: var(--glow-cold);
    border: 1px solid rgba(50, 150, 255, 0.3);
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #1a1f1d;
    border: 1px solid var(--accent-gold);
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: var(--shadow-heavy);
    color: #fff;
    text-align: center;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 20px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-btn:hover {
    color: #fff;
}

.strategy-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 1.5rem;
}

.row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    align-items: center;
}

.row.header {
    font-weight: bold;
    color: var(--accent-gold);
    background: transparent;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
}

.action-hit {
    color: #e74c3c;
    font-weight: bold;
}

/* Red for Hit/Danger */
.action-stand {
    color: #f1c40f;
    font-weight: bold;
}

/* Yellow for Stand/Caution */

.modal-note {
    font-size: 0.8rem;
    color: #aaa;
    margin-top: 1.5rem;
}

/* Visual Feedback Animations */
@keyframes flashGreen {
    0% {
        box-shadow: 0 0 0 rgba(74, 222, 128, 0);
    }

    50% {
        box-shadow: 0 0 50px rgba(74, 222, 128, 0.5) inset;
        border: 2px solid #4ade80;
    }

    100% {
        box-shadow: 0 0 0 rgba(74, 222, 128, 0);
    }
}

@keyframes flashRed {
    0% {
        box-shadow: 0 0 0 rgba(239, 68, 68, 0);
    }

    50% {
        box-shadow: 0 0 50px rgba(239, 68, 68, 0.5) inset;
        border: 2px solid #ef4444;
    }

    100% {
        box-shadow: 0 0 0 rgba(239, 68, 68, 0);
    }
}

.flash-green {
    animation: flashGreen 0.5s ease-out;
}

.flash-red {
    animation: flashRed 0.5s ease-out;
}

/* =========================================
   Pillar Page / Article Styles
   ========================================= */

/* Article Layout */
main {
    width: 100%;
    background-color: var(--bg-color);
}

article {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem 4rem 1.5rem;
}

/* Typography for Article */
article h1 {
    font-size: 3rem;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    color: var(--accent-gold);
}

article h2 {
    font-size: 2.2rem;
    margin-top: 3rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    padding-bottom: 0.5rem;
    color: #fff;
}

article h3 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 0.8rem;
    color: var(--accent-gold);
}

article p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: #e0e0e0;
}

article ul,
article ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

article li {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 0.5rem;
    color: #e0e0e0;
}

article strong {
    color: #fff;
}

/* Embedded App Container */
.app-container {
    margin: 3rem -1.5rem;
    /* Break out of container slightly on small screens */
    border-top: 2px solid var(--accent-gold);
    border-bottom: 2px solid var(--accent-gold);
    box-shadow: var(--shadow-heavy);
    overflow: hidden;
    position: relative;
    background-color: #000;
}

/* Adjust the existing .view to work inside the embed */
.embedded-view .view {
    min-height: 600px;
    /* Force height for the game area */
    height: auto;
    position: relative;
}

/* Adjust Main Menu for Embed */
.embedded-view #main-menu {
    min-height: 500px;
    padding: 3rem 1rem;
}

.embedded-view #game-view {
    min-height: 600px;
}

/* Author/E-E-A-T Styles */
.author-box {
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 12px;
    margin-top: 4rem;
    display: flex;
    gap: 1.5rem;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.author-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: var(--accent-gold);
    object-fit: cover;
    display: block;
}

.disclaimer {
    font-size: 0.9rem;
    color: #888;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-style: italic;
}

/* Responsive Adjustments for Article */
@media (max-width: 600px) {
    article h1 {
        font-size: 2.2rem;
    }

    .app-container {
        margin: 2rem -1rem;
        border-radius: 0;
    }

    .embedded-view .view {
        min-height: 500px;
    }
}