/* ── Reset & Base ─────────────────────────────── */
#agile-poker-app {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #0f1117;
    color: #e8eaf0;
    min-height: 100vh;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    z-index: 9990;
}

#agile-poker-app * {
    box-sizing: border-box;
}

/* ── Screens ──────────────────────────────────── */
.ap-screen {
    display: none;
    width: 100%;
    min-height: 100vh;
}

.ap-screen-active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Center Box (join/host screens) ───────────── */
.ap-center-box {
    background: #1a1d27;
    border: 1px solid #2e3248;
    border-radius: 16px;
    padding: 48px 40px;
    text-align: center;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}

.ap-logo {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 0 8px;
    color: #ffffff;
}

.ap-logo-small {
    font-size: 1rem;
    font-weight: 600;
    color: #a0a8c0;
}

.ap-tagline {
    color: #8890a8;
    margin: 0 0 32px;
    font-size: 1rem;
}

.ap-small {
    color: #6068808;
    font-size: 0.8rem;
    margin-top: 16px;
}

/* ── Form Elements ────────────────────────────── */
.ap-form-group {
    margin-bottom: 20px;
}

.ap-input {
    width: 100%;
    padding: 14px 18px;
    background: #0f1117;
    border: 2px solid #2e3248;
    border-radius: 10px;
    color: #e8eaf0;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.ap-input:focus {
    border-color: #6c63ff;
}

/* ── Buttons ──────────────────────────────────── */
.ap-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.ap-btn-large {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    border-radius: 12px;
}

.ap-btn-primary {
    background: #6c63ff;
    color: #ffffff;
}

.ap-btn-primary:hover {
    background: #574fd6;
    transform: translateY(-1px);
}

.ap-btn-secondary {
    background: #2e3248;
    color: #e8eaf0;
}

.ap-btn-secondary:hover {
    background: #3a3f5c;
}

.ap-btn-success {
    background: #22c55e;
    color: #ffffff;
}

.ap-btn-success:hover {
    background: #16a34a;
}

/* ── Game Screen ──────────────────────────────── */
#ap-screen-game {
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    min-height: 100vh;
}

#ap-screen-game.ap-screen-active {
    display: flex;
}

#ap-game-header {
    width: 100%;
    max-width: 900px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: #1a1d27;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid #2e3248;
}

#ap-round-indicator {
    font-weight: 700;
    font-size: 1.1rem;
    color: #6c63ff;
}

#ap-player-count {
    font-size: 0.85rem;
    color: #8890a8;
}

/* ── Table ────────────────────────────────────── */
#ap-table-wrap {
    width: 100%;
    max-width: 900px;
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

#ap-table {
    position: relative;
    width: 700px;
    height: 340px;
}

#ap-table-surface {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 420px;
    height: 180px;
    background: linear-gradient(135deg, #1a472a, #166534);
    border-radius: 90px;
    border: 4px solid #15803d;
    box-shadow: 0 4px 30px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

#ap-table-label {
    color: rgba(255,255,255,0.25);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ── Player Seats ─────────────────────────────── */
.ap-seat {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: default;
}

.ap-seat-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #2e3248;
    border: 3px solid #3a3f5c;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: #ffffff;
    position: relative;
    transition: border-color 0.3s;
}

.ap-seat-avatar.ap-voted {
    border-color: #22c55e;
}

.ap-seat-avatar.ap-empty {
    background: #1a1d27;
    border-color: #2e3248;
    opacity: 0.4;
}

.ap-seat-name {
    font-size: 0.75rem;
    color: #a0a8c0;
    max-width: 70px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ap-seat-name.ap-you {
    color: #6c63ff;
    font-weight: 700;
}

.ap-seat-card {
    font-size: 0.8rem;
    font-weight: 700;
    background: #6c63ff;
    color: white;
    border-radius: 6px;
    padding: 2px 8px;
    display: none;
}

.ap-seat-card.ap-visible {
    display: block;
}

/* ── Host Controls ────────────────────────────── */
#ap-host-controls {
    width: 100%;
    max-width: 900px;
    background: #1a1d27;
    border: 1px solid #2e3248;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#ap-share-box {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: #8890a8;
}

#ap-share-link {
    flex: 1;
    background: #0f1117;
    border: 1px solid #2e3248;
    border-radius: 8px;
    padding: 8px 12px;
    color: #e8eaf0;
    font-size: 0.85rem;
}

#ap-round-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ap-select {
    background: #0f1117;
    border: 1px solid #2e3248;
    border-radius: 8px;
    padding: 10px 14px;
    color: #e8eaf0;
    font-size: 0.9rem;
}

/* ── Card Deck ────────────────────────────────── */
#ap-card-deck {
    width: 100%;
    max-width: 900px;
    background: #1a1d27;
    border: 1px solid #2e3248;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.ap-deck-label {
    font-size: 0.85rem;
    color: #8890a8;
    margin-bottom: 12px;
}

#ap-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ap-card {
    width: 58px;
    height: 80px;
    background: #2e3248;
    border: 2px solid #3a3f5c;
    border-radius: 10px;
    color: #e8eaf0;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ap-card:hover {
    background: #3a3f5c;
    border-color: #6c63ff;
    transform: translateY(-4px);
}

.ap-card.ap-selected {
    background: #6c63ff;
    border-color: #6c63ff;
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(108,99,255,0.4);
}

/* ── Timer ────────────────────────────────────── */
#ap-timer {
    font-size: 2rem;
    font-weight: 700;
    color: #6c63ff;
    margin-bottom: 12px;
}

#ap-timer.ap-urgent {
    color: #ef4444;
    animation: ap-pulse 0.5s infinite;
}

@keyframes ap-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ── Results ──────────────────────────────────── */
#ap-results {
    width: 100%;
    max-width: 900px;
    background: #1a1d27;
    border: 1px solid #2e3248;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

#ap-results h3 {
    margin: 0 0 16px;
    color: #ffffff;
}

#ap-results-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.ap-result-item {
    background: #2e3248;
    border-radius: 10px;
    padding: 10px 16px;
    text-align: center;
    min-width: 80px;
}

.ap-result-player {
    font-size: 0.75rem;
    color: #8890a8;
    margin-bottom: 4px;
}

.ap-result-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #6c63ff;
}

#ap-results-summary {
    font-size: 0.9rem;
    color: #a0a8c0;
    border-top: 1px solid #2e3248;
    padding-top: 12px;
}

/* ── Emoji Overlay ────────────────────────────── */
#ap-emoji-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.ap-flying-emoji {
    position: absolute;
    font-size: 2rem;
    pointer-events: none;
    z-index: 9999;
}

/* ── Emoji Context Menu ───────────────────────── */
#ap-emoji-menu {
    position: fixed;
    background: #1a1d27;
    border: 1px solid #2e3248;
    border-radius: 12px;
    padding: 12px;
    z-index: 10000;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
    min-width: 220px;
}

.ap-emoji-menu-title {
    font-size: 0.8rem;
    color: #8890a8;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #2e3248;
}

#ap-emoji-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.ap-emoji-option {
    background: #2e3248;
    border: none;
    border-radius: 8px;
    padding: 8px;
    font-size: 1.3rem;
    cursor: pointer;
    transition: background 0.15s;
}

.ap-emoji-option:hover {
    background: #3a3f5c;
}/* ── Full screen game page overrides ─────────── */

/* Hide header, footer, page title and spacers */
body:has(#agile-poker-app) header.wp-block-template-part,
body:has(#agile-poker-app) footer.wp-block-template-part,
body:has(#agile-poker-app) .wp-block-post-title,
body:has(#agile-poker-app) .wp-block-spacer {
    display: none !important;
}

/* Remove the 620px content width constraint */
body:has(#agile-poker-app) .is-layout-constrained > *,
body:has(#agile-poker-app) .wp-block-post-content,
body:has(#agile-poker-app) .entry-content {
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Remove padding from the site blocks wrapper */
body:has(#agile-poker-app) .wp-site-blocks {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Remove padding from the main content group */
body:has(#agile-poker-app) main.wp-block-group {
    padding: 0 !important;
    margin: 0 !important;
}

/* Make body background match the game */
body:has(#agile-poker-app) {
    background: #0f1117 !important;
    padding: 0 !important;
    margin-top: 0 !important;
}