/* Doki.se — game page, ported from templates/game.twig (Slim). Loaded on /spel/* only. */

/* ===== POKI SINGLE GAME STYLE ===== */
:root {
    --fontBody: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --fontTorus: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", system-ui, -apple-system, "Segoe UI", sans-serif;
    --bezier: cubic-bezier(.25,.1,.25,1);
    --cellSize: 94px;
    --cellSpacing: 16px;

    /* Poki Colors */
    --poki-blue: #009cff;
    --blue-1: #002b50;
    --blue-3: #054a91;
    --blue-5: #0074e0;
    --green-5: #3cf7dc;
    --green-7: #83ffe7;
    --grey-3: #5d6b84;
    --grey-5: #bac9de;
    --grey-7: #f0f5fc;
    --pure-white: #fff;

    /* Shadows */
    --shadow-mid: 0px 7px 10px 4px #5d6b8433;
    --shadow-hover: 0px 12px 16px 8px #5d6b844d;
}

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

body {
    font: 400 16px/24px var(--fontBody);
    color: var(--blue-1);
    background: url('/images/doki_pattern.svg') repeat, linear-gradient(135deg, #e8f4fc 0%, #f0e8fc 50%, #fce8f0 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* ===== POKI GAME LAYOUT ===== */
.game-page {
    display: flex;
    gap: var(--cellSpacing);
    padding: var(--cellSpacing);
    max-width: 1870px;
    margin: 0 auto;
    align-items: start;
}

/* Left Sidebar - Game Grid */
.side-grid {
    display: grid;
    gap: var(--cellSpacing);
    grid-template-columns: repeat(1, var(--cellSize));
    grid-auto-rows: var(--cellSize);
    align-content: start;
}

.side-grid.left { 
    grid-template-columns: repeat(2, var(--cellSize));
    grid-template-rows: var(--cellSize) repeat(auto-fill, var(--cellSize)); 
}
.side-grid.right { grid-template-columns: repeat(3, var(--cellSize)); }

/* Logo Cell - 2:1 Ratio Clone */
.logo-cell {
    grid-column: span 2;
    grid-row: span 1;
    height: var(--cellSize);
    background: var(--pure-white);
    border-radius: 16px;
    box-shadow: var(--shadow-mid);
    padding: 0;
    display: flex;
    overflow: hidden;
}

.logo-left {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 8px;
}

.logo-text {
    font: 700 28px var(--fontTorus);
    color: var(--blue-1);
    text-decoration: none;
    letter-spacing: -1px;
}

.logo-text span {
    color: var(--poki-blue);
}

.logo-right {
    width: 64px;
    display: flex;
    flex-direction: column;
    border-left: 2px solid var(--grey-7);
}

.tool-btn {
    flex: 1;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--poki-blue);
    transition: background 0.2s;
    text-decoration: none;
}

.tool-btn:hover {
    background: var(--grey-7);
}

.tool-btn.search-btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 3px;
}

.tool-btn.profile-btn svg {
    width: 22px;
    height: 22px;
    stroke-width: 2.5px;
}

/* Game Tiles */
.game-tile {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-mid);
    transition: transform 0.15s var(--bezier), box-shadow 0.15s var(--bezier);
    cursor: pointer;
    background: var(--pure-white);
    aspect-ratio: 1/1;
}

.game-tile:hover {
    transform: scale(1.06);
    z-index: 10;
    box-shadow: var(--shadow-hover);
}

.game-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Overlay Title on Hover */
.tile-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 12px;
    background: rgba(0, 43, 80, 0.8);
    color: white;
    font: 700 14px var(--fontTorus);
    text-align: center;
    transform: translateY(100%);
    transition: transform 0.2s var(--bezier);
    z-index: 20;
    pointer-events: none;
}

.game-tile:hover .tile-title {
    transform: translateY(0);
}

.tile-1x1 { grid-column: span 1; grid-row: span 1; }
.tile-2x2 { grid-column: span 2; grid-row: span 2; }
.tile-3x3 { grid-column: span 3; grid-row: span 3; }

/* ===== MAIN GAME AREA ===== */
.game-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Game Container */
.game-container {
    background: var(--pure-white);
    border-radius: 20px;
    box-shadow: var(--shadow-mid);
    overflow: hidden;
    flex: none;
    display: flex;
    flex-direction: column;
}

/* Game Player */
.game-player {
    display: grid;
    flex: none;
    position: relative;
    background: #1a1a2e;
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 400px;
}

.game-player iframe {
    width: 100%;
    height: 100%;
    border: 0;
    position: absolute;
    top: 0;
    left: 0;
}

/* Facade Pattern */
.game-facade {
    position: relative;
    min-height: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #1a1a2e; /* Fallback */
    cursor: pointer;
    overflow: hidden;
}

.facade-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 100%, #4930a0 0%, #2a1b60 58%, #1a1637 100%);
    z-index: 1;
    overflow: hidden;
}

/* Animated Pattern */
.doki-pattern::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
    animation: panBg 60s linear infinite;
}

/* Floating Shapes */
.doki-pattern::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(108, 92, 231, 0.2) 0%, transparent 20%),
        radial-gradient(circle at 80% 70%, rgba(255, 107, 107, 0.15) 0%, transparent 20%);
    animation: rotateBg 30s linear infinite;
}

@keyframes panBg {
    0% { transform: translateY(0); }
    100% { transform: translateY(40px); }
}

@keyframes rotateBg {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.facade-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: 640px;
    padding: 36px 28px;
}

.facade-icon {
    width: 128px;
    height: 128px;
    border-radius: 28px;
    box-shadow: 0 16px 32px rgba(0,0,0,0.3);
    border: 4px solid rgba(255,255,255,0.1);
    object-fit: cover;
    animation: float 6s ease-in-out infinite;
}

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

.unavailable-msg {
    color: #e2dcff;
    font: 500 14px/1.5 var(--fontBody);
    text-align: center;
}

.game-title-facade {
    font: 800 clamp(26px, 3.2vw, 42px)/1.15 var(--fontTorus);
    color: var(--pure-white);
    text-shadow: 0 4px 8px rgba(0,0,0,0.4);
    margin-bottom: 0; /* Removing large margin */
    letter-spacing: -1px;
    text-align: center;
    overflow-wrap: anywhere;
}

.game-modes {
    display: flex;
    justify-content: center;
    z-index: 10;
    width: 100%;
    flex-wrap: wrap;
    gap: 12px;
}

.game-mode-btn {
    position: relative;
    min-width: 200px;
    min-height: 56px;
    padding: 12px 24px;
    border: none;
    border-radius: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font: 800 17px/1.3 var(--fontTorus);
    text-decoration: none;
    transition: all 0.2s var(--bezier);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.game-mode-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.4);
}

.game-mode-btn:active {
    transform: translateY(1px);
}

/* Primary Play Button - Gradient Blue (Homogeneous) */
.game-mode-btn.primary {
    background: linear-gradient(135deg, #009cff 0%, #0074e0 100%);
    color: white;
    border-bottom: 4px solid #005bb5; /* 3D effect */
}

.game-mode-btn.primary:hover {
    background: linear-gradient(135deg, #33b0ff 0%, #0084ff 100%);
}

/* Shine effect */
.game-mode-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.3), transparent);
    transform: rotate(45deg) translate(-100%, -100%);
    transition: transform 0.6s;
}

.game-mode-btn:hover::after {
    transform: rotate(45deg) translate(100%, 100%);
}

.mode-icon {
    font-size: 24px;
    display: flex;
    align-items: center;
}

/* Game Info Bar */
.game-info-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    gap: 16px;
    background: var(--pure-white);
    border-top: 1px solid var(--grey-7);
}

.game-info-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.game-icon {
    width: 48px;
    height: 48px;
    border-radius: 13px;
    object-fit: cover;
    flex-shrink: 0;
}

.game-info-text h1 {
    font: 800 20px/1.3 var(--fontTorus);
    color: var(--blue-1);
    margin: 0;
    overflow-wrap: anywhere;
}

.game-info-text p {
    font: 400 13px var(--fontBody);
    color: var(--grey-3);
    margin: 0;
}

.game-info-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.info-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: var(--grey-7);
    border-radius: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--grey-3);
    transition: all 0.2s;
}

.info-btn:hover {
    background: var(--poki-blue);
    color: white;
}

.info-btn svg {
    width: 20px;
    height: 20px;
}

/* ===== POKI-STYLE CONTENT ZONE ===== */
.game-content-zone {
    background: var(--poki-blue);
    border-radius: 20px;
    overflow: hidden;
}

/* Breadcrumbs */
.content-breadcrumbs {
    padding: 12px 24px;
    font: 400 12px var(--fontBody);
    color: rgba(255,255,255,0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    overflow-wrap: anywhere;
}

.content-breadcrumbs a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
}

.content-breadcrumbs a:hover {
    color: white;
    text-decoration: underline;
}

.content-breadcrumbs span {
    margin: 0 6px;
}

/* Content Inner */
.content-inner {
    background: white;
    padding: 28px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 176px;
    gap: 32px;
}

@media (max-width: 768px) {
    .content-inner {
        grid-template-columns: 1fr;
    }
}

/* Title Section */
.content-title {
    font: 700 28px var(--fontTorus);
    color: var(--blue-1);
    margin-bottom: 8px;
}

.content-author {
    font: 400 14px var(--fontBody);
    color: var(--grey-3);
    margin-bottom: 12px;
}

.content-author a {
    color: var(--poki-blue);
    text-decoration: none;
}

/* Description */
.content-description {
    font: 400 15px/1.75 var(--fontBody);
    color: #4f6079;
    margin-bottom: 24px;
}

/* FAQ Sections */
.content-faq h3 {
    font: 700 16px var(--fontTorus);
    color: var(--blue-1);
    margin: 16px 0 8px;
}

.content-faq p,
.content-faq ul {
    font: 400 15px/1.7 var(--fontBody);
    color: var(--grey-3);
    margin: 0;
}

.faq-item { border-top: 1px solid var(--grey-7); }
.faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 0;
    color: var(--blue-1);
    font: 700 16px/1.5 var(--fontTorus);
    cursor: pointer;
    list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '';
    width: 8px;
    height: 8px;
    flex-shrink: 0;
    border-right: 2px solid var(--poki-blue);
    border-bottom: 2px solid var(--poki-blue);
    transform: rotate(45deg);
    margin-right: 4px;
}
.faq-item[open] summary::after { transform: rotate(225deg); }
.faq-answer { padding: 0 0 18px; }

.content-faq ul {
    padding-left: 20px;
    margin-top: 8px;
}

.content-faq a {
    color: var(--poki-blue);
    text-decoration: none;
}

.content-faq a:hover {
    text-decoration: underline;
}

/* Category Tags */
.content-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--grey-7);
}

.content-tag {
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid var(--grey-5);
    border-radius: 50px;
    font: 400 12px var(--fontBody);
    color: var(--blue-1);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: all 0.2s;
}

.content-tag:hover {
    background: var(--poki-blue);
    border-color: var(--poki-blue);
    color: white;
}

/* Thumbnail Side */
.content-thumbnail {
    width: 176px;
    height: 176px;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow-mid);
}

.content-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Hide sidebars on mobile */
@media (max-width: 1200px) {
    .side-grid.left { display: none; }
}

@media (max-width: 1500px) {
    .side-grid.right { display: none; }
}

@media (max-width: 768px) {
    .game-page {
        padding: 10px;
    }
    .game-main { gap: 20px; }
    .game-player { aspect-ratio: 4 / 3; min-height: 360px; }
    .facade-content { gap: 16px; padding: 28px 22px; }
    .facade-icon { width: 96px; height: 96px; border-radius: 24px; }
    .game-title-facade { font-size: 28px; }
    .game-mode-btn { min-width: 180px; min-height: 54px; font-size: 16px; }
    .mode-icon { font-size: 20px; }
    .game-info-bar { padding: 14px 16px; }
    .game-info-text h1 { font-size: 18px; }
    .content-inner { grid-template-columns: minmax(0, 1fr); padding: 22px; }
    .content-thumbnail { display: none; }
    .content-breadcrumbs { padding: 12px 22px; }
}

/* ===== Additions for the Laravel rebuild ===== */
/* Logo row above the player when the left column is hidden */
.compact-logo { display: none; margin: 0; }
@media (max-width: 1200px) {
    .compact-logo { display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-rows: 72px; }
    .compact-logo .logo-tile { grid-column: 1; width: 100%; height: 72px; aspect-ratio: auto; border-radius: 18px; }
    .compact-logo .logo-link { flex: none; width: 156px; }
    .compact-logo .logo-link img { max-width: 130px; max-height: 48px; }
    .compact-logo .logo-actions { margin-left: auto; width: 104px; flex-direction: row; }
    .compact-logo .logo-actions a,
    .compact-logo .logo-actions button { width: 52px; border-bottom: 0; }
    .compact-logo .logo-actions a { border-right: 1px solid var(--grey-7); }
}

/* Same related games below the content when the side columns are hidden */
.related-below { display: none; }
.related-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin: 0 0 14px; }
.related-heading h2 { font: 800 21px/1.3 var(--fontTorus); color: #fff; margin: 0; }
.related-heading > a { color: #fff; font-size: 13px; font-weight: 700; white-space: nowrap; text-decoration: none; }
.related-heading > a:hover { text-decoration: underline; }
.related-below .poki-grid {
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    grid-auto-rows: auto;
    gap: 12px;
}
.related-below .game-tile { aspect-ratio: 1; width: 100%; }
@media (max-width: 1500px) { .related-below { display: block; } }

.game-facade:focus-visible { outline: 4px solid var(--poki-blue); outline-offset: -4px; }
.game-mode-btn:focus-visible,
.info-btn:focus-visible,
.faq-item summary:focus-visible,
.game-page .game-tile:focus-visible { outline: 3px solid var(--poki-blue); outline-offset: 4px; }
.game-unavailable { cursor: default; }
.game-player.is-unavailable { aspect-ratio: auto; }
.game-unavailable .facade-content { max-width: 600px; gap: 18px; }
.game-unavailable .unavailable-msg { margin-top: 0; }
.game-unavailable .game-mode-btn { min-width: 140px; }
.game-mode-btn:disabled,
.game-mode-btn:disabled:hover {
    background: rgba(255,255,255,0.09);
    color: #b9b3cf;
    border: 1px solid rgba(255,255,255,0.12);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}
.game-mode-btn:disabled::after { display: none; }
.unavailable-alternative {
    color: var(--pure-white);
    text-decoration: none;
}
.game-main { min-width: 0; }
@media (max-width: 768px) {
    .game-unavailable .facade-content { gap: 14px; }
    .game-unavailable .game-modes { flex-direction: column; align-items: stretch; gap: 10px; }
    .game-unavailable .game-mode-btn { min-width: 0; }
    .game-unavailable .game-mode-btn:disabled { min-height: 44px; }
    .related-heading h2 { font-size: 18px; }
    .related-below .poki-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
    .related-below .game-tile:nth-child(n+13) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .facade-icon, .doki-pattern::before, .doki-pattern::after { animation: none; }
    .game-mode-btn, .game-tile, .tile-title { transition: none; }
}
