/* ============================================
   Workto Arcade - Base Stylesheet
   Brand: Workto | Free Online H5 Games
   ============================================ */

:root {
    --arcade-bg: #0c1b33;
    --arcade-surface: #132744;
    --arcade-surface-alt: #1a3358;
    --arcade-header-bg: #0a1628;
    --arcade-accent: #e8453e;
    --arcade-accent-glow: #ff6b5e;
    --arcade-accent-soft: rgba(232, 69, 62, 0.15);
    --arcade-text: #f0f4f8;
    --arcade-text-dim: #a8bdd4;
    --arcade-text-muted: #7a94b0;
    --arcade-border: rgba(255, 255, 255, 0.08);
    --arcade-border-hover: rgba(232, 69, 62, 0.5);
    --arcade-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    --arcade-shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.35);
    --arcade-radius: 14px;
    --arcade-radius-sm: 8px;
    --arcade-radius-lg: 20px;
    --arcade-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    max-width: 680px;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
    margin: 0 auto;
    padding: 0;
    background: var(--arcade-bg);
    color: var(--arcade-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

/* ---- Header / Navigation ---- */
.top-bar {
    width: 100%;
    max-width: 680px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--arcade-header-bg);
    color: var(--arcade-text);
    height: 52px;
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.logo-mark img {
    height: 32px;
    display: block;
    cursor: pointer;
}

.nav-drawer {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--arcade-header-bg);
    position: fixed;
    top: 52px;
    right: 0;
    width: 200px;
    height: calc(100vh - 52px);
    padding: 20px 0;
    z-index: 99;
    border-left: 1px solid var(--arcade-border);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
    transform: translateX(100%);
    transition: transform var(--arcade-transition);
    overflow-y: auto;
}

.nav-drawer.open {
    transform: translateX(0);
}

.nav-drawer li {
    border-bottom: 1px solid var(--arcade-border);
}

.nav-drawer li a {
    display: block;
    padding: 14px 24px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--arcade-text-dim);
    transition: all var(--arcade-transition);
}

.nav-drawer li a:hover,
.nav-drawer li a:focus {
    color: var(--arcade-accent);
    background: var(--arcade-accent-soft);
    padding-left: 30px;
}

.nav-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    cursor: pointer;
    border: none;
    background: transparent;
    padding: 0;
}

.nav-toggle-btn img {
    width: 24px;
    height: 24px;
}

/* ---- Arcade Tile (Game Card) ---- */
.arcade-tile {
    position: relative;
    border-radius: var(--arcade-radius);
    padding: 10px;
    background: var(--arcade-surface);
    border: 1px solid var(--arcade-border);
    transition: all var(--arcade-transition);
    overflow: hidden;
}

.arcade-tile:hover {
    transform: translateY(-4px);
    border-color: var(--arcade-border-hover);
    box-shadow: var(--arcade-shadow-lg), 0 0 0 2px var(--arcade-accent-soft);
}

.arcade-tile a {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
}

.tile-cover img,
.tile-cover-featured img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 10px;
    background: var(--arcade-surface-alt);
    transition: transform var(--arcade-transition);
}

.arcade-tile:hover .tile-cover img,
.arcade-tile:hover .tile-cover-featured img {
    transform: scale(1.03);
}

.tile-meta {
    padding: 8px 2px 4px;
}

.tile-meta .tile-name {
    color: var(--arcade-accent);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tile-meta .tile-desc {
    color: var(--arcade-text-muted);
    font-size: 0.68rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- Shelf (Content Section) ---- */
.shelf-section {
    margin: 0 12px;
    padding: 12px 0;
}

.shelf-section-detail {
    margin: 12px 16px;
    padding: 12px 0;
}

.shelf-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: linear-gradient(90deg, var(--arcade-header-bg) 0%, var(--arcade-surface-alt) 60%, var(--arcade-accent) 100%);
    border-radius: var(--arcade-radius-sm);
    margin-bottom: 12px;
}

.shelf-heading .shelf-title {
    color: var(--arcade-text);
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
}

.shelf-heading .shelf-more {
    width: 22px;
    height: 22px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity var(--arcade-transition);
}

.shelf-heading .shelf-more:hover {
    opacity: 1;
}

.shelf-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.shelf-grid-wide {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

/* ---- Game Detail Page ---- */
.game-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 16px;
    border-radius: var(--arcade-radius);
}

.game-hero-art {
    width: 80%;
}

.game-hero-art img {
    width: 100%;
    border-radius: var(--arcade-radius);
    object-fit: cover;
    aspect-ratio: 1 / 0.8;
}

.game-hero-info {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 16px;
}

.game-hero-info .game-title {
    color: var(--arcade-text);
    font-size: 1.1rem;
    font-weight: 700;
    margin: 12px 0 6px;
    text-align: center;
}

.game-hero-info .game-desc {
    color: var(--arcade-text-dim);
    font-size: 0.88rem;
    line-height: 1.5;
    text-align: center;
    margin-bottom: 12px;
}

.game-hero-info .game-updated {
    color: var(--arcade-text-muted);
    font-size: 0.75rem;
    margin-bottom: 8px;
}

.play-btn-float {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 36px;
    background: linear-gradient(135deg, var(--arcade-accent, #e63946), #c1121f);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(230, 57, 70, 0.4);
    margin-top: 12px;
}

.play-btn-float:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(230, 57, 70, 0.6);
}

.play-btn-float img {
    width: 28px;
    height: 28px;
}

.play-btn-float .play-label {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 0;
}

/* ---- Game Brief ---- */
.game-brief {
    margin: 16px;
    padding: 20px;
    background: var(--arcade-surface);
    border: 1px solid var(--arcade-border);
    border-radius: var(--arcade-radius);
}

.game-brief p {
    color: var(--arcade-text);
    line-height: 1.6;
    font-size: 0.9rem;
}

/* ---- Game FAQ Section ---- */
.game-faq {
    margin: 16px;
    padding: 20px;
    background: var(--arcade-surface);
    border: 1px solid var(--arcade-border);
    border-radius: var(--arcade-radius);
}

.game-faq .faq-title {
    color: var(--arcade-accent);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--arcade-accent-soft);
}

.game-faq details {
    margin-bottom: 10px;
    border-bottom: 1px solid var(--arcade-border);
    padding-bottom: 10px;
}

.game-faq details:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.game-faq summary {
    color: var(--arcade-text);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 0;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.game-faq summary::before {
    content: '▸';
    color: var(--arcade-accent);
    font-size: 0.8rem;
    transition: transform var(--arcade-transition);
    flex-shrink: 0;
}

.game-faq details[open] summary::before {
    transform: rotate(90deg);
}

.game-faq summary::-webkit-details-marker {
    display: none;
}

.game-faq .faq-answer {
    color: var(--arcade-text-dim);
    font-size: 0.82rem;
    line-height: 1.55;
    padding: 8px 0 4px 20px;
}

/* ---- Game iframe Player ---- */
.game-frame {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    height: 100vh;
    position: relative;
}

.frame-back-btn {
    position: absolute;
    top: 16px;
    left: 16px;
    height: 40px;
    cursor: pointer;
    z-index: 10;
    opacity: 0.8;
    transition: opacity var(--arcade-transition);
}

.frame-back-btn:hover {
    opacity: 1;
}

/* ---- Footer ---- */
.site-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 16px;
    background: var(--arcade-header-bg);
    border-top: 1px solid var(--arcade-border);
    text-align: center;
}

.site-map-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.site-map-links a {
    font-size: 0.72rem;
    color: var(--arcade-text-muted);
    transition: color var(--arcade-transition);
}

.site-map-links a:hover {
    color: var(--arcade-accent);
    text-decoration: underline;
}

.site-copy {
    font-size: 0.72rem;
    color: var(--arcade-text-muted);
    opacity: 0.7;
}

/* ---- Floating Actions ---- */
.float-actions {
    position: fixed;
    bottom: 80px;
    right: 12px;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: var(--arcade-accent);
    padding: 8px;
    border-radius: 50px;
    box-shadow: var(--arcade-shadow);
    z-index: 50;
    transition: background var(--arcade-transition);
}

.float-actions.visible {
    display: flex;
}

.float-actions:hover {
    background: var(--arcade-accent-glow);
}

.float-actions img {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* ---- Tile Badge ---- */
.tile-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 0 0 8px 8px;
    z-index: 5;
}

.tile-badge img {
    width: 14px;
    height: 14px;
}

.tile-badge .badge-score {
    color: #ffd700;
    font-size: 0.7rem;
    font-weight: 700;
}

/* ---- Article / Static Pages ---- */
.article-body {
    color: var(--arcade-text);
    padding: 20px;
    line-height: 1.7;
}

.article-body h3 {
    font-size: 1.2rem;
    color: var(--arcade-text);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--arcade-accent);
}

.article-body h4 {
    font-size: 1rem;
    color: var(--arcade-accent);
    margin: 20px 0 10px;
}

.article-body p {
    font-size: 0.88rem;
    color: var(--arcade-text-dim);
    margin-bottom: 12px;
    line-height: 1.65;
}

.article-body ul {
    padding-left: 20px;
    margin-bottom: 12px;
}

.article-body li {
    font-size: 0.88rem;
    color: var(--arcade-text-dim);
    margin-bottom: 6px;
    list-style: disc;
}

.article-body a {
    color: var(--arcade-accent);
    text-decoration: underline;
}

.article-body strong {
    color: var(--arcade-text);
}

/* ---- Error Page ---- */
.error-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
}

.error-screen h1 {
    font-size: 2rem;
    color: var(--arcade-text);
    margin-bottom: 12px;
}

.error-screen p {
    font-size: 1rem;
    color: var(--arcade-text-dim);
    margin-bottom: 20px;
}

.error-screen img {
    width: 100%;
    max-width: 400px;
    padding: 20px 0;
}

/* ---- Language Switcher ---- */
.lang-switch {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
}

.lang-switch a {
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 4px;
    color: var(--arcade-text-muted);
    border: 1px solid var(--arcade-border);
    transition: all var(--arcade-transition);
}

.lang-switch a.active,
.lang-switch a:hover {
    color: var(--arcade-text);
    border-color: var(--arcade-accent);
    background: var(--arcade-accent-soft);
}

/* ---- Hero Play Button (PT detail pages) ---- */
.hero-play-btn {
    display: inline-block;
    padding: 14px 36px;
    background: linear-gradient(135deg, var(--arcade-accent, #e63946), #c1121f);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 8px;
    text-decoration: none;
    text-align: center;
    margin-top: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(230, 57, 70, 0.4);
}

.hero-play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(230, 57, 70, 0.6);
}

/* ---- PT game-hero layout ---- */
main.game-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 16px;
}

main.game-hero .hero-cover {
    width: 100%;
    max-width: 400px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}

main.game-hero .hero-cover img {
    width: 100%;
    display: block;
}

main.game-hero .hero-info {
    text-align: center;
    margin-bottom: 16px;
}

main.game-hero .hero-desc {
    max-width: 700px;
    margin: 0 auto 20px;
    padding: 16px;
    background: var(--arcade-card-bg, rgba(255,255,255,0.05));
    border-radius: 10px;
}

main.game-hero .hero-desc h2 {
    color: var(--arcade-text);
    font-size: 1rem;
    margin-bottom: 8px;
}

main.game-hero .hero-desc p {
    color: var(--arcade-text-dim);
    font-size: 0.9rem;
    line-height: 1.6;
}

main.game-hero .shelf-section {
    width: 100%;
    max-width: 900px;
    margin-top: 20px;
}
