/*
Theme Name: Gargamelts
Theme URI: https://gargamelts.example
Author: Gargamelts
Author URI: https://gargamelts.example
Description: Retro-Fernseher-Startseite mit Menue, Unterseiten, Mini-Game und Event-Ankuendigung fuer GARGAMELTS.
Version: 2.8
Requires at least: 5.8
Requires PHP: 7.4
License: Unlicense
Text Domain: gargamelts
*/


  @import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap');

  :root{
    --khaki: #a89a78;
    --khaki-dark: #8a7c5c;
    --screen: #d8d8cc;
    --ink: #1b1b17;
    --red: #c1272d;
    --green: #2f5233;
    --amber: #b5651d;
    --blue: #2a4d69;
    --pixel-cut: rgba(0,0,0,0.4);
  }

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

  html,body{
    height:100%;
    width:100%;
    background:var(--khaki-dark);
    font-family:'VT323', monospace;
    overflow:hidden;
  }

  body{
    display:flex;
    align-items:stretch;
    justify-content:stretch;
  }

  .tv{
    position:relative;
    width:100vw;
    height:100vh;
    background:linear-gradient(160deg, var(--khaki), var(--khaki-dark));
    border-radius:0;
    box-shadow:
      inset 0 0 0 2px rgba(0,0,0,0.15);
    padding:26px 22px 60px 22px;
    display:flex;
    flex-direction:column;
  }

  .tv::after{
    content:"GARGAMELTS";
    position:absolute;
    bottom:16px;
    left:0;
    right:0;
    text-align:center;
    font-family:'Press Start 2P', monospace;
    font-size:11px;
    letter-spacing:2px;
    color:rgba(0,0,0,0.35);
    text-shadow: 0 1px 0 rgba(255,255,255,0.15);
  }

  .screen{
    position:relative;
    flex:1;
    background:var(--screen);
    border-radius:6px;
    overflow:hidden;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5), inset 0 0 3px #000;
  }

  .screen::before{
    content:"";
    position:absolute;
    inset:0;
    background:repeating-linear-gradient(
      to bottom,
      rgba(0,0,0,0.08) 0px,
      rgba(0,0,0,0.08) 1px,
      transparent 2px,
      transparent 3px
    );
    pointer-events:none;
    z-index:50;
    mix-blend-mode:multiply;
  }
  .screen::after{
    content:"";
    position:absolute;
    inset:0;
    box-shadow: inset 0 0 60px 10px rgba(0,0,0,0.45);
    pointer-events:none;
    z-index:51;
  }

  .screen.flicker{
    animation: flicker 4s infinite;
  }
  @keyframes flicker{
    0%,100%{ filter:brightness(1); }
    3%{ filter:brightness(0.85); }
    4%{ filter:brightness(1.05); }
    46%{ filter:brightness(1); }
    47%{ filter:brightness(0.8); }
    48%{ filter:brightness(1); }
    70%{ filter:brightness(1); }
    71%{ filter:brightness(0.9); }
  }

  .panel{
    position:absolute;
    inset:0;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    opacity:0;
    pointer-events:none;
    transition:opacity .15s linear;
  }
  .panel.active{
    opacity:1;
    pointer-events:auto;
  }

  #panel-start{
    gap:22px;
    padding:20px;
    justify-content:center;
  }
  .hero-wrap{
    width:100%;
    max-width:560px;
    margin:0 auto;
    border-radius:4px;
    overflow:hidden;
    box-shadow:0 0 0 2px rgba(0,0,0,0.25);
  }
  .hero-wrap img{
    display:block;
    width:100%;
    height:auto;
    image-rendering:pixelated;
  }
  .press-start{
    font-family:'Press Start 2P', monospace;
    font-size:14px;
    color:var(--ink);
    background:none;
    border:none;
    cursor:pointer;
    letter-spacing:1px;
    animation: blink 1s steps(1) infinite;
    padding:10px;
  }
  .press-start:focus-visible{
    outline:2px dashed var(--ink);
  }
  @keyframes blink{
    0%,49%{opacity:1;}
    50%,100%{opacity:0;}
  }
  .copyright{
    font-family:'Press Start 2P', monospace;
    font-size:9px;
    color:rgba(27,27,23,0.55);
    letter-spacing:1px;
  }

  #panel-off{
    background:#000;
  }
  .off-line{
    position:absolute;
    left:0; right:0;
    top:50%;
    height:6px;
    background:#fff;
    transform:translateY(-50%) scaleY(1);
    box-shadow:0 0 20px 4px rgba(255,255,255,0.8);
  }
  .off-dot{
    position:absolute;
    left:50%; top:50%;
    width:6px; height:6px;
    background:#fff;
    border-radius:50%;
    transform:translate(-50%,-50%) scale(0);
  }

  .off-collapse .off-line{
    animation: collapseLine .35s ease-in forwards;
  }
  .off-collapse .off-dot{
    animation: dotPop .35s ease-in forwards;
  }
  @keyframes collapseLine{
    0%{ transform:translateY(-50%) scaleY(1); }
    60%{ transform:translateY(-50%) scaleY(0.02); opacity:1;}
    100%{ transform:translateY(-50%) scaleY(0.02); opacity:0; }
  }
  @keyframes dotPop{
    0%{ transform:translate(-50%,-50%) scale(0); opacity:0; }
    65%{ transform:translate(-50%,-50%) scale(1.4); opacity:1; }
    100%{ transform:translate(-50%,-50%) scale(0); opacity:0; }
  }

  /* power-ON: reverse of the collapse, used for every menu/page switch */
  .off-expand .off-dot{
    animation: dotPopIn .3s ease-out forwards;
  }
  .off-expand .off-line{
    animation: expandLine .3s ease-out .12s forwards;
  }
  @keyframes dotPopIn{
    0%{ transform:translate(-50%,-50%) scale(0); opacity:0; }
    50%{ transform:translate(-50%,-50%) scale(1.3); opacity:1; }
    100%{ transform:translate(-50%,-50%) scale(0); opacity:0; }
  }
  @keyframes expandLine{
    0%{ transform:translateY(-50%) scaleY(0.02); opacity:0; }
    30%{ transform:translateY(-50%) scaleY(0.02); opacity:1; }
    100%{ transform:translateY(-50%) scaleY(1); opacity:0; }
  }

  #panel-home{
    justify-content:flex-start;
    align-items:stretch;
    padding:0;
    gap:0;
    overflow:hidden;
    background:#2a2a24;
  }

  /* full-bleed animated static behind the whole home screen, like an old
     recorded VHS tape running under the menu */
  .home-static{
    position:absolute;
    inset:0;
    width:100%;
    height:100%;
    display:block;
    image-rendering:pixelated;
    filter: contrast(1.05) brightness(0.9);
    z-index:0;
  }

  .home-back-btn{
    position:absolute;
    top:14px;
    left:14px;
    z-index:6;
  }

  /* translucent panel holding the menu, sitting on top of the static scene
     (static still bleeds through at the edges, like an old CRT overlay) */
  .home-content{
    position:relative;
    z-index:2;
    margin:52px 14px 14px;
    padding:16px 14px 10px;
    background:rgba(200,197,178,0.88);
    border:2px solid rgba(0,0,0,0.55);
    border-radius:4px;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.08) inset, 0 6px 18px rgba(0,0,0,0.5);
    display:flex;
    flex-direction:column;
    flex:1;
    max-width:560px;
    margin-left:auto;
    margin-right:auto;
    overflow-y:auto;
  }

  .home-header{
    font-family:'Press Start 2P', monospace;
    font-size: clamp(18px, 6vw, 26px);
    color:var(--ink);
    letter-spacing:1px;
    margin-bottom:6px;
    text-align:left;
    text-shadow:1px 1px 0 rgba(255,255,255,0.15);
  }
  .home-rule{
    width:100%;
    height:2px;
    background:rgba(27,27,23,0.5);
    margin-bottom:22px;
  }

  .menu-grid{
    display:grid;
    grid-template-columns:repeat(3, 1fr);
    gap:22px 10px;
    width:100%;
    flex:1;
  }
  .menu-item{
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:8px;
    background:none;
    border:none;
    cursor:pointer;
    font-family:'Press Start 2P', monospace;
    font-size:11px;
    letter-spacing:0.5px;
  }
  .menu-item:focus-visible{
    outline:2px dashed var(--ink);
  }
  .icon-stage{
    width:clamp(72px, 20vw, 96px);
    height:clamp(72px, 20vw, 96px);
    display:flex;
    align-items:center;
    justify-content:center;
    transition: transform .18s ease, filter .18s ease;
  }
  .menu-item:hover .icon-stage,
  .menu-item:focus-visible .icon-stage,
  .menu-item.spin .icon-stage{
    transform: translateY(-6px) scale(1.12);
    filter: drop-shadow(0 0 10px currentColor) drop-shadow(0 0 18px currentColor);
  }

  .icon-art{
    width:100%;
    height:100%;
    object-fit:contain;
    image-rendering:pixelated;
    pointer-events:none;
    animation: floatWobble 3.4s ease-in-out infinite;
  }
  /* stagger each icon slightly so they don't all bob in unison */
  .menu-item.shop  .icon-art{ animation-delay: 0s;    }
  .menu-item.info  .icon-art{ animation-delay: .3s;  }
  .menu-item.tape  .icon-art{ animation-delay: .6s;  }
  .menu-item.pager .icon-art{ animation-delay: .9s;  }
  .menu-item.forum .icon-art{ animation-delay: 1.2s; }
  .menu-item.about .icon-art{ animation-delay: 1.5s; }
  .menu-item.play  .icon-art{ animation-delay: 1.8s; }

  .menu-item:hover .icon-art,
  .menu-item:focus-visible .icon-art,
  .menu-item.spin .icon-art{
    animation-duration: 1.1s;
  }
  @keyframes floatWobble{
    0%,100%{ transform: translateY(0) rotate(-4deg); }
    50%{ transform: translateY(-5px) rotate(4deg); }
  }

  @media (prefers-reduced-motion: reduce){
    .icon-art{ animation:none; }
  }

  .menu-item.shop  { color:var(--green); }
  .menu-item.info  { color:var(--ink); }
  .menu-item.tape  { color:var(--ink); }
  .menu-item.pager { color:var(--green); }
  .menu-item.forum { color:var(--amber); }
  .menu-item.about { color:var(--red); }
  .menu-item.play  { color:var(--blue); }

  .home-footer{
    text-align:center;

    font-family:'Press Start 2P', monospace;
    font-size:8px;
    color:rgba(27,27,23,0.45);
    line-height:1.9;
    padding:14px 0 6px;
    letter-spacing:0.5px;
  }
  .footer-link{
    background:none;
    border:none;
    font-family:'Press Start 2P', monospace;
    font-size:8px;
    color:rgba(27,27,23,0.55);
    letter-spacing:0.5px;
    text-decoration:underline;
    cursor:pointer;
    padding:2px;
  }
  .footer-link:hover{ color:var(--ink); }

  /* -------- SUB-PANELS (SHOP, NEWS, DVD, CONTACT, FORUM, ABOUT, PLAY) -------- */
  .subpanel{
    justify-content:flex-start;
    align-items:stretch;
    padding:22px 16px 16px;
    gap:16px;
    width:100%;
    max-width:560px;
    margin:0 auto;
  }
  .sub-header{
    display:flex;
    align-items:center;
    gap:14px;
    font-family:'Press Start 2P', monospace;
    font-size:16px;
    color:var(--ink);
    letter-spacing:1px;
    border-bottom:2px solid rgba(27,27,23,0.5);
    padding-bottom:14px;
  }
  .back-btn{
    font-family:'Press Start 2P', monospace;
    font-size:16px;
    color:var(--ink);
    background:none;
    border:2px solid var(--ink);
    border-radius:4px;
    width:34px;
    height:34px;
    cursor:pointer;
    line-height:1;
    flex-shrink:0;
  }
  .back-btn:hover{
    background:rgba(27,27,23,0.1);
  }
  .sub-content{
    flex:1;
    overflow-y:auto;
    display:flex;
    flex-direction:column;
    justify-content:flex-start;
  }
  .sub-placeholder{
    font-family:'VT323', monospace;
    font-size:20px;
    color:var(--ink);
    line-height:1.5;
  }

  /* -------- filled content pages (ABOUT / SHOP / NEWS / CONTACT / FORUM) -------- */
  .content-heading{
    font-family:'Press Start 2P', monospace;
    font-size:14px;
    color:var(--ink);
    letter-spacing:1px;
    margin-bottom:14px;
  }
  .content-copy{
    font-family:'VT323', monospace;
    font-size:20px;
    color:var(--ink);
    line-height:1.55;
    margin-bottom:14px;
  }
  .content-highlight{
    font-family:'Press Start 2P', monospace;
    font-size:12px;
    color:var(--amber);
    letter-spacing:1px;
    line-height:1.8;
    border:2px solid var(--amber);
    padding:12px;
    margin-top:8px;
    display:inline-block;
  }
  .status-tag{
    font-family:'Press Start 2P', monospace;
    font-size:10px;
    letter-spacing:1px;
    color:var(--green);
    border:2px solid var(--green);
    padding:6px 10px;
    display:inline-block;
    margin-top:6px;
  }
  .terminal-line{
    font-family:'VT323', monospace;
    font-size:19px;
    color:var(--ink);
    line-height:1.7;
  }
  .terminal-line b{
    font-family:'Press Start 2P', monospace;
    font-size:11px;
    letter-spacing:0.5px;
  }
  .news-card{
    border:2px solid rgba(27,27,23,0.55);
    border-radius:4px;
    padding:12px 14px;
    margin-bottom:16px;
    background:rgba(255,255,255,0.18);
  }
  .news-card h3{
    font-family:'Press Start 2P', monospace;
    font-size:12px;
    color:var(--amber);
    letter-spacing:0.5px;
    margin-bottom:8px;
  }
  .news-card p{
    font-family:'VT323', monospace;
    font-size:19px;
    color:var(--ink);
    line-height:1.5;
    margin-bottom:8px;
  }

  .gallery-grid{
    display:grid;
    grid-template-columns:repeat(2, 1fr);
    gap:12px;
  }
  .gallery-tile{
    aspect-ratio:4/3;
    border:2px solid var(--ink);
    border-radius:6px;
    background:#111;
    cursor:pointer;
    overflow:hidden;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:0;
  }
  .gallery-tile img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
  }
  .gallery-placeholder{
    font-family:'Press Start 2P', monospace;
    font-size:11px;
    color:#888;
    letter-spacing:1px;
  }

  @media (prefers-reduced-motion: reduce){
    .screen.flicker, .press-start{ animation:none; }
  }

  /* -------- MINI-GAME (PLAY) -------- */
  .game-sub-content{ padding:0; overflow:hidden; flex:1; display:flex; min-height:0; }
  .game-wrap{
    position:relative;
    width:100%;
    flex:1;
    min-height:0;
    background:#111;
    border-radius:4px;
    overflow:hidden;
    box-shadow:0 0 0 2px rgba(0,0,0,0.4);
  }
  .game-canvas{
    width:100%;
    height:100%;
    display:block;
    image-rendering:pixelated;
  }
  .game-hud{
    position:absolute;
    top:6px; left:8px; right:8px;
    display:flex;
    justify-content:space-between;
    font-family:'Press Start 2P', monospace;
    font-size:10px;
    color:#fff;
    text-shadow:1px 1px 0 #000;
    z-index:3;
    pointer-events:none;
  }
  .game-overlay{
    position:absolute;
    inset:0;
    z-index:5;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:14px;
    background:rgba(0,0,0,0.72);
    text-align:center;
    padding:16px;
  }
  .game-title{
    font-family:'Press Start 2P', monospace;
    color:#ffd24a;
    font-size:18px;
    line-height:1.5;
    text-shadow:2px 2px 0 #000;
  }
  .game-sub{
    font-family:'VT323', monospace;
    color:#fff;
    font-size:16px;
    max-width:80%;
  }
  .game-btn{
    font-family:'Press Start 2P', monospace;
    font-size:13px;
    color:#1b1b17;
    background:#ffd24a;
    border:2px solid #000;
    border-radius:4px;
    padding:10px 18px;
    cursor:pointer;
  }
  .game-btn:hover{ background:#fff; }

  .hs-entry{
    display:flex;
    gap:8px;
    align-items:center;
  }
  .hs-input{
    font-family:'Press Start 2P', monospace;
    font-size:11px;
    color:#1b1b17;
    background:#fff;
    border:2px solid #000;
    border-radius:4px;
    padding:8px 10px;
    width:130px;
    text-transform:uppercase;
  }
  .hs-save-btn{
    font-size:11px;
    padding:8px 12px;
  }
  .hs-list{
    width:100%;
    max-width:260px;
    max-height:140px;
    overflow-y:auto;
    font-family:'VT323', monospace;
    font-size:17px;
    color:#fff;
    text-align:left;
    border-top:2px solid rgba(255,255,255,0.3);
    border-bottom:2px solid rgba(255,255,255,0.3);
    padding:6px 4px;
  }
  .hs-list-row{
    display:flex;
    justify-content:space-between;
    padding:2px 4px;
  }
  .hs-list-row.me{
    color:#ffd24a;
  }
  .hs-empty{
    text-align:center;
    color:rgba(255,255,255,0.6);
    font-size:15px;
  }

  /* direct touch/drag control needs the browser to not intercept the
     finger movement as a page scroll */
  .game-wrap{
    touch-action: none;
  }
  /* ==================================================================
     EVENT ANNOUNCEMENT (DOS/CRT transmission) - purely additive,
     does not touch any existing TV/menu/game styles above.
     ================================================================== */
  .event-boot{
    position:fixed;
    inset:0;
    z-index:999;
    background:#000;
    display:flex;
    align-items:center;
    justify-content:center;
    font-family:'VT323', monospace;
  }
  .event-boot[hidden]{ display:none; }

  .boot-screen{
    width:100%;
    height:100%;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:20px;
  }
  .boot-line{
    color:#c8c8c8;
    font-size:20px;
    line-height:1.6;
    white-space:pre-wrap;
    margin:0;
  }
  .boot-cursor{
    display:inline-block;
    width:9px; height:18px;
    background:#c8c8c8;
    vertical-align:middle;
    margin-left:2px;
    animation: bootBlink .8s steps(1) infinite;
  }
  @keyframes bootBlink{ 0%,49%{opacity:1;} 50%,100%{opacity:0;} }

  .event-window{
    position:relative;
    width:min(92vw, 460px);
    max-height:90vh;
    overflow-y:auto;
    background:#0000aa;
    border:4px solid #d8d8cc;
    box-shadow: 0 0 0 2px #000, 0 12px 40px rgba(0,0,0,0.7);
    padding:18px 18px 54px;
    color:#fff;
    animation: eventFlicker 3.2s infinite;
  }
  @keyframes eventFlicker{
    0%,100%{ filter:brightness(1); }
    4%{ filter:brightness(0.92); }
    5%{ filter:brightness(1.04); }
    52%{ filter:brightness(1); }
    53%{ filter:brightness(0.88); }
    54%{ filter:brightness(1); }
  }
  .event-window::after{
    content:"";
    position:absolute;
    inset:0;
    pointer-events:none;
    background:repeating-linear-gradient(
      to bottom, rgba(0,0,0,0.12) 0px, rgba(0,0,0,0.12) 1px,
      transparent 2px, transparent 3px
    );
    mix-blend-mode:multiply;
  }

  .event-titlebar{
    display:flex;
    align-items:center;
    gap:10px;
    border-bottom:2px solid #fff;
    padding-bottom:10px;
    margin-bottom:14px;
  }
  .event-titletext{
    font-family:'Press Start 2P', monospace;
    font-size:11px;
    letter-spacing:1px;
  }

  /* pixel warning triangle, drawn from blocky rects (no emoji, no smooth icon) */
  .warn-icon{
    width:28px;
    height:26px;
    flex-shrink:0;
  }

  .event-line{
    font-size:20px;
    line-height:1.5;
    margin:0 0 8px;
  }
  .event-line.strong{
    font-family:'Press Start 2P', monospace;
    font-size:12px;
    line-height:1.8;
    color:#ffd24a;
    margin-bottom:12px;
  }
  .event-line.big{
    font-family:'Press Start 2P', monospace;
    font-size:15px;
    line-height:1.7;
    color:#fff;
    margin-bottom:14px;
  }
  .event-thanks{
    font-size:17px;
    line-height:1.5;
    margin-top:16px;
    color:#c9d6ff;
  }

  .event-links{
    display:flex;
    flex-direction:column;
    gap:10px;
    margin:16px 0;
  }
  .event-link{
    font-family:'VT323', monospace;
    font-size:22px;
    color:#ffd24a;
    background:none;
    border:none;
    text-align:left;
    cursor:pointer;
    padding:2px 0;
    text-decoration:none;
    display:inline-block;
    width:fit-content;
  }
  .event-prompt{ color:#fff; margin-right:4px; }
  .event-cursor{
    display:inline-block;
    margin-left:2px;
    animation: bootBlink .8s steps(1) infinite;
  }
  .event-link:hover, .event-link:focus-visible{
    text-decoration:underline;
  }

  .event-langbar{
    position:absolute;
    bottom:14px;
    left:18px;
    display:flex;
    gap:14px;
  }
  .lang-btn{
    font-family:'Press Start 2P', monospace;
    font-size:10px;
    color:#fff;
    background:none;
    border:none;
    cursor:pointer;
    letter-spacing:1px;
  }
  .lang-btn.active{ color:#ffd24a; }
  .lang-btn:hover{ text-decoration:underline; }

  .event-close{
    position:absolute;
    bottom:14px;
    right:18px;
    font-family:'Press Start 2P', monospace;
    font-size:10px;
    color:#c9d6ff;
    background:none;
    border:none;
    cursor:pointer;
    letter-spacing:1px;
  }
  .event-close:hover{ color:#fff; }

  .readme-window .event-titletext{ letter-spacing:0.5px; }
  .readme-body{ max-height:50vh; overflow-y:auto; }

  @media (max-width: 420px){
    .event-window{ padding:14px 14px 50px; }
    .event-line{ font-size:18px; }
    .event-line.big{ font-size:13px; }
    .boot-line{ font-size:17px; }
  }

  @media (prefers-reduced-motion: reduce){
    .event-window{ animation:none; }
    .boot-cursor, .event-cursor{ animation:none; }
  }
