/* Get Love Room — renkler logolardan: gece siyahı, güneş sarısı, ay kreması */
:root {
  --bg: #000; --panel: #15120b; --line: #3a3320; --ink: #fff6d8; --dim: #b8ad8c;
  --sun: #fcdf4b; --sun2: #f5cf2e; --moon: #fff6d8; --rose: #ff6f8f; --ok: #9ee6a8;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: 'Pixelify Sans', monospace; overflow: hidden; -webkit-user-select: none; user-select: none; overscroll-behavior: none; }
button { font: inherit; cursor: pointer; }
input { font: inherit; }

/* Açılış */
#intro { position: fixed; inset: 0; z-index: 50; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; animation: iOut .8s ease 2.6s forwards; }
#intro img { width: min(40vmin, 220px); mix-blend-mode: lighten; animation: iIn 1.2s ease both; }
#intro p { margin: 0; color: var(--dim); letter-spacing: .32em; font-size: clamp(10px, 2.4vw, 13px); text-align: center; animation: iIn 1.2s ease .5s both; }
#intro p b { color: var(--sun); letter-spacing: .4em; }
@keyframes iIn { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }
@keyframes iOut { to { opacity: 0; visibility: hidden; } }

/* Ekranlar */
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; background: radial-gradient(circle at 50% 32%, #262009 0%, #000 58%); }
.logo { width: min(44vmin, 220px); mix-blend-mode: lighten; animation: float 5s ease-in-out infinite; }
.logo.sm { width: min(30vmin, 150px); }
@keyframes float { 50% { transform: translateY(-6px); } }
h1 { margin: 0; font-size: 32px; letter-spacing: 3px; }
h1 span, h2 span { color: var(--sun); }
h2 { margin: 0; font-size: 24px; }
h3 { margin: 0 0 6px; font-size: 20px; color: var(--sun); }
.screen p { margin: 0; color: var(--dim); max-width: 34ch; line-height: 1.5; }
.small { font-size: 12px; color: var(--dim); }
.row { display: flex; gap: 8px; align-items: center; }
.or { color: var(--dim); font-size: 12px; }
input { background: var(--panel); color: var(--ink); border: 2px solid var(--line); border-radius: 8px; padding: 10px 12px; text-align: center; width: min(56vw, 200px); }
input:focus { outline: none; border-color: var(--sun); }
button { background: #221d13; color: var(--ink); border: 2px solid var(--line); border-radius: 8px; padding: 10px 16px; font-size: 16px; }
button:hover { border-color: var(--sun); }
button:disabled { opacity: .55; cursor: default; }
button.primary { background: var(--sun); color: #1a1608; border-color: var(--sun); font-weight: 700; box-shadow: 0 0 18px rgba(252, 223, 75, .3); }
button.link { background: none; border: 0; color: var(--dim); font-size: 13px; text-decoration: underline; padding: 4px; }
.g { display: inline-block; width: 22px; height: 22px; line-height: 22px; border-radius: 50%; background: #fff; color: #4285f4; font-weight: 700; margin-right: 6px; }

/* Dünya: sahne tüm ekranı kaplar, kamera karakteri takip eder */
#world { position: fixed; inset: 0; overflow: hidden; background: radial-gradient(circle at 50% 50%, #1a160c, #000 70%); touch-action: none; }
#stage { position: absolute; left: 0; top: 0; will-change: transform; }
#stage canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; }
#ov { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
#top { position: fixed; top: 0; left: 0; right: 0; padding: max(8px, env(safe-area-inset-top)) 12px 18px; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; z-index: 6; pointer-events: none; background: linear-gradient(rgba(0, 0, 0, .55), transparent); }
#top > * { pointer-events: auto; }
#top .who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; text-shadow: 0 1px 2px #000; }
#top b { color: var(--sun); font-size: 18px; }
#status { color: var(--ink); opacity: .85; font-size: 14px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; padding: 5px 10px; border-radius: 999px; background: rgba(21, 18, 11, .85); border: 1.5px solid var(--line); color: var(--ink); backdrop-filter: blur(6px); }
.chip .ic { width: 16px; height: 16px; }
.chip.warn { border-color: var(--rose); color: #ffd0da; animation: pulse 1.6s infinite; }
#inviteChip { border-color: var(--sun); }
#relChip { border-color: #ff9ec4; color: #ffd6e5; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(255, 111, 143, .18); } }
.conn { width: 12px; height: 12px; padding: 0; border-radius: 50%; border: 2px solid rgba(0, 0, 0, .5); background: #777; cursor: pointer; }
.conn.ok { background: #5be37a; box-shadow: 0 0 8px #5be37a; }
.conn.wait { background: #ffc93c; animation: pulse 1s infinite; }
.conn.bad { background: #ff4f7b; }

/* Alt çubuk: modern ikonlar */
.ic { width: 22px; height: 22px; display: block; flex: none; }
#bar { position: fixed; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 6px; align-items: center; background: rgba(18, 15, 9, .78); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); border: 1px solid rgba(255, 246, 216, .12); border-radius: 22px; padding: 7px; z-index: 6; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
#bar button { width: 46px; height: 46px; padding: 0; border-radius: 15px; display: grid; place-items: center; background: rgba(255, 246, 216, .06); border: 0; color: var(--ink); transition: transform .12s, background .2s; }
#bar button:hover { background: rgba(255, 246, 216, .14); }
#bar button:active { transform: scale(.92); }
#bar button.off { color: #9a917a; }
#bar button.on { background: rgba(252, 223, 75, .18); color: var(--sun); }
#bar button.love { color: #ff8fab; }
#bar button.hub { background: var(--sun); color: #1a1608; }
#bar .sep { width: 1px; height: 26px; background: rgba(255, 246, 216, .15); margin: 0 2px; }
#help { position: fixed; bottom: 82px; left: 50%; transform: translateX(-50%); color: var(--ink); font-size: 12px; white-space: nowrap; opacity: .55; text-shadow: 0 1px 2px #000; pointer-events: none; z-index: 5; }
@media (max-width: 700px) {
  #help { display: none; }
  #bar { gap: 3px; padding: 5px; border-radius: 18px; }
  #bar button { width: 38px; height: 40px; border-radius: 12px; }
  #bar .sep { margin: 0; }
  .ic { width: 20px; height: 20px; }
  #status { font-size: 12px; }
}
@media (max-width: 360px) { #bar button { width: 33px; } }

/* Düzenleme modu */
#editBar { position: fixed; top: max(56px, calc(env(safe-area-inset-top) + 48px)); left: 50%; transform: translateX(-50%); z-index: 7; display: flex; gap: 6px; align-items: center; background: rgba(18, 15, 9, .9); border: 2px solid var(--sun); border-radius: 14px; padding: 6px 8px; font-size: 13px; white-space: nowrap; }
#editBar button { padding: 6px 10px; font-size: 13px; }
body.editing #bar, body.editing #help { display: none; }

/* TV (film) katmanı */
#tvLayer { position: fixed; inset: 0; pointer-events: none; z-index: 2; }
.tvbox { position: fixed; background: #000; overflow: hidden; pointer-events: auto; }
.tvbox.away { left: -9999px !important; top: 0 !important; width: 320px !important; height: 180px !important; }
.tvbox .yt, .tvbox .yt iframe, .tvbox video, .tvbox .web { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: contain; background: #000; }
.tvbox .file, .tvbox .yt { display: none; }
.tvbox[data-kind=yt] .yt, .tvbox[data-kind=file] .file { display: block; }
.tvbox .screen { display: none; }
.tvbox.has-screen .screen { display: block; z-index: 2; }
.tvbox .tvtap { position: absolute; inset: 0; z-index: 3; cursor: zoom-in; }
.tvbox .web { display: none; background: #fff; }
.tvbox[data-kind=web] .web { display: block; }
.tvbox.incinema .tvtap, .tvbox.full .tvtap { display: none; }
.tvjoin { position: absolute; z-index: 4; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; gap: 6px; align-items: center; font-size: 15px; background: var(--sun); color: #1a1608; border: 0; font-weight: 700; }
.tvbox:not(.incinema):not(.full) .tvjoin { font-size: 10px; padding: 3px 6px; }
.tvcount { position: absolute; z-index: 5; inset: 0; display: grid; place-items: center; font-size: clamp(28px, 8vw, 80px); color: var(--sun); background: rgba(0,0,0,.55); text-shadow: 0 2px 8px #000; pointer-events: none; }
.tvbox.full { left: 0 !important; top: 0 !important; width: 100% !important; height: calc(100% - 64px) !important; z-index: 15; }
.sharesrc { position: fixed; left: -10px; top: -10px; width: 2px; height: 2px; opacity: 0; pointer-events: none; }
/* Sinema: kamera TV'ye yakınlaşır, alt çubuğun yerine film kontrolleri gelir */
body.cinema #bar, body.cinema #help { display: none; }
body.cinema #top { background: linear-gradient(rgba(0,0,0,.4), transparent); }
.cinebar { position: fixed; left: 50%; bottom: max(10px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 16; display: flex; flex-direction: column; gap: 6px; align-items: center; background: rgba(18,15,9,.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid rgba(255,246,216,.12); border-radius: 20px; padding: 8px 10px; width: min(96vw, 520px); }
.cinfo { display: flex; gap: 10px; align-items: center; width: 100%; font-size: 13px; }
.ctitle { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.csync { color: var(--dim); white-space: nowrap; font-size: 12px; }
.csync.ok { color: var(--ok); } .csync.warn { color: #ffc93c; }
.cbtns { display: flex; gap: 6px; justify-content: center; }
.cbtns button { width: 44px; height: 42px; padding: 0; display: grid; place-items: center; border-radius: 13px; border: 0; background: rgba(255,246,216,.08); color: var(--ink); }
.cbtns button .ic { margin: 0; }
.cbtns button.love { color: #ff8fab; }
@media (max-width: 380px) { .cbtns button { width: 38px; } }

/* Oyun katmanı */
.tag { position: absolute; transform: translate(-50%, -100%); white-space: nowrap; font-size: 13px; text-shadow: 0 1px 0 #000, 0 0 3px #000; }
.voice { display: inline-flex; gap: 2px; align-items: flex-end; height: 10px; margin-left: 4px; vertical-align: middle; }
.voice i { width: 2px; background: var(--ok); animation: v .45s infinite alternate ease-in-out; }
.voice i:nth-child(2) { animation-delay: -.2s; } .voice i:nth-child(3) { animation-delay: -.35s; }
@keyframes v { from { height: 2px; } to { height: 10px; } }
.muted { color: var(--rose); font-size: 9px; vertical-align: middle; }
.prompt { position: absolute; transform: translate(-50%, -100%); background: #1a1608; color: var(--moon); border: 2px solid var(--sun); border-radius: 6px; padding: 2px 8px; font-size: 13px; white-space: nowrap; }
.fx { position: absolute; font-size: 18px; transform: translate(-50%, -100%); animation: up 1.5s ease-out forwards; }
@keyframes up { to { transform: translate(-50%, -260%); opacity: 0; } }
.bubble { pointer-events: auto; cursor: zoom-in; position: absolute; width: 52px; height: 52px; transform: translate(-50%, -100%); border-radius: 50%; overflow: hidden; border: 2px solid var(--sun); box-shadow: 0 4px 10px rgba(0, 0, 0, .5); background: #000; }
.bubble video { width: 100%; height: 100%; object-fit: cover; }
.bubble.me video { transform: scaleX(-1); }

/* Bildirim, marka */
#toast { position: fixed; top: max(54px, calc(env(safe-area-inset-top) + 46px)); left: 50%; transform: translateX(-50%); background: var(--moon); color: #1a1608; padding: 7px 14px; border-radius: 10px; font-weight: 600; font-size: 14px; opacity: 0; transition: opacity .4s; z-index: 30; pointer-events: none; text-align: center; max-width: 90vw; }
#brand { position: fixed; right: 10px; bottom: 4px; display: flex; align-items: center; gap: 6px; color: var(--dim); font-size: 10px; opacity: .5; pointer-events: none; letter-spacing: .12em; z-index: 1; }
#brand img { width: 18px; height: 18px; mix-blend-mode: lighten; }
#world:not([hidden]) ~ #brand { display: none; }

/* Pencereler */
.modal { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .66); display: flex; align-items: center; justify-content: center; padding: 16px; }
.card { background: var(--panel); border: 2px solid var(--line); border-radius: 18px; padding: 18px; width: min(92vw, 380px); max-height: 90vh; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.card label { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--dim); font-size: 14px; }
.linkbox { background: #000; border: 2px dashed var(--line); border-radius: 8px; padding: 8px; font-size: 12px; word-break: break-all; user-select: text; -webkit-user-select: text; }
#preview { width: 120px; height: 120px; align-self: center; image-rendering: pixelated; background: radial-gradient(circle, #2b2410, #15120b); border-radius: 12px; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.opts .lbl { width: 100%; color: var(--dim); font-size: 12px; }
.opts button { padding: 5px 9px; font-size: 13px; }
.opts button.sel { border-color: var(--sun); background: #2b2410; }
.opts .sw { width: 28px; height: 28px; padding: 0; border-radius: 50%; }

/* Özellik penceresi */
.card.sheet { width: min(94vw, 440px); max-height: min(88vh, 760px); padding-top: 0; }
.card.sheet.wide { width: min(96vw, 860px); }
@media (max-width: 600px) {
  #sheet { align-items: flex-end; padding: 0; }
  .card.sheet, .card.sheet.wide { width: 100%; max-height: 88vh; border-radius: 20px 20px 0 0; border-bottom: 0; padding-bottom: max(18px, env(safe-area-inset-bottom)); }
}
.sheethead { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: sticky; top: 0; background: var(--panel); margin: 0 -18px; padding: 14px 18px 8px; z-index: 1; }
.sheethead h3 { display: flex; align-items: center; gap: 8px; margin: 0; }
.sheethead .x { width: 36px; height: 36px; padding: 0; display: grid; place-items: center; border-radius: 50%; }
.sheethead .x svg { width: 20px; height: 20px; }
#sheetBody { display: flex; flex-direction: column; gap: 10px; }
#sheetBody p { margin: 0; line-height: 1.45; }
#sheetBody small { color: var(--dim); }
#sheetBody input:not([type=color]):not([type=date]), #sheetBody textarea { width: 100%; text-align: left; }
#sheetBody input[type=date] { width: auto; }
textarea { font: inherit; background: var(--panel); color: var(--ink); border: 2px solid var(--line); border-radius: 8px; padding: 10px 12px; resize: vertical; }
textarea:focus { outline: none; border-color: var(--sun); }
input, textarea { -webkit-user-select: text; user-select: text; }
.row.wrap { flex-wrap: wrap; }
.row.grow > input { flex: 1; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.note { background: #2a1416; border: 1px solid #5a2a32; color: #ffd0da; padding: 8px 10px; border-radius: 8px; font-size: 13px; }
button .ic { display: inline-block; vertical-align: -5px; width: 20px; height: 20px; margin-right: 4px; }
#bar button .ic { margin: 0; }
a.btn { display: inline-flex; align-items: center; background: #221d13; color: var(--ink); border: 2px solid var(--line); border-radius: 8px; padding: 8px 12px; text-decoration: none; font-size: 14px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button { padding: 6px 12px; font-size: 14px; border-radius: 999px; }
.tabs button.sel, .row button.sel { background: var(--sun); color: #1a1608; border-color: var(--sun); }
.tile { text-align: left; display: flex; flex-direction: column; gap: 2px; }
.tile small { color: var(--dim); }
.list { display: flex; flex-direction: column; gap: 4px; }
.list .item { text-align: left; font-size: 14px; padding: 8px 10px; }
.nowplaying { display: flex; flex-direction: column; gap: 8px; background: #1d180d; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.nowplaying b { display: block; }
.diag { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--line); padding: 4px 0; }
.okc { color: var(--ok); } .badc { color: var(--rose); }
.bigvideo { width: 100%; border-radius: 12px; background: #000; max-height: 70vh; }
.bigvideo.mirror { transform: scaleX(-1); }

/* Birlikte menüsü */
.hubgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.hubtile { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; border-radius: 14px; text-align: left; background: #1d180d; }
.hubtile .hi { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: rgba(252, 223, 75, .12); color: var(--sun); }
.hubtile .hi .ic { margin: 0; }
.hubtile b { font-size: 15px; } .hubtile small { color: var(--dim); font-size: 11px; }
.hubtile:nth-child(3n+2) .hi { background: rgba(255, 111, 143, .14); color: #ff8fab; }
.hubtile:nth-child(3n) .hi { background: rgba(63, 183, 164, .16); color: #6fd6c5; }

/* Müzik */
.np { display: flex; gap: 12px; align-items: center; background: #1d180d; border-radius: 14px; padding: 10px; }
.np img, .npart { width: 76px; height: 76px; border-radius: 10px; object-fit: cover; flex: none; display: grid; place-items: center; background: #2b2410; }
.np b { display: block; } .np .row { margin-top: 6px; flex-wrap: wrap; }
.nowplaying .row button { flex: 1 1 auto; font-size: 14px; padding: 8px 10px; }
.np .row button { width: 42px; height: 40px; padding: 0; display: grid; place-items: center; }
.np .row button .ic { margin: 0; }
button.spotify { background: #1db954; border-color: #1db954; color: #04130a; box-shadow: none; }
.pls { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.pl { display: flex; flex-direction: column; gap: 4px; padding: 6px; font-size: 12px; text-align: left; }
.pl img, .pl .npart { width: 100%; height: auto; aspect-ratio: 1; border-radius: 8px; object-fit: cover; }
.pl span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Fotoğraflar */
.bigphoto { width: 100%; max-height: 60vh; object-fit: contain; border-radius: 10px; background: #000; }
.album { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.album figure { margin: 0; background: #fff6e6; padding: 6px 6px 4px; border-radius: 4px; cursor: pointer; transform: rotate(-1deg); box-shadow: 0 4px 10px rgba(0, 0, 0, .35); }
.album figure:nth-child(2n) { transform: rotate(1.2deg); }
.album img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.album figcaption { color: #3a2418; font-size: 12px; padding-top: 3px; text-align: center; }
.booth { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.slot { display: flex; flex-direction: column; gap: 6px; align-items: center; background: #fff6e6; color: #3a2418; padding: 8px; border-radius: 6px; }
.slot img, .slot video, .slot .empty { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; background: #e8dcc6; display: grid; place-items: center; font-size: 13px; text-align: center; }
.slot video { transform: scaleX(-1); }
.slot button { font-size: 13px; padding: 5px 9px; }
.countdown { font-size: 44px; color: var(--sun); min-width: 30px; text-align: center; }
.strip-prev { width: 100%; border-radius: 8px; }
@media (max-width: 520px) { .booth { grid-template-columns: 1fr 1fr; } .countdown { grid-column: 1 / -1; order: -1; } }

/* Günlük, saat, kavanoz */
.diary { display: flex; flex-direction: column; gap: 8px; }
.diary article, .answers article, .logq { background: #fff6e6; color: #3a2418; border-radius: 10px; padding: 10px 12px; }
.diary article.moon { background: #eef0ff; }
.diary header { display: flex; justify-content: space-between; gap: 8px; }
#sheetBody .diary header small { color: #8a7a60; }
.diary p, .answers p, .logq p { white-space: pre-wrap; margin: 6px 0 0 !important; }
.locked { color: var(--dim); display: flex; align-items: center; gap: 6px; }
.diary .locked { color: #8a7a60; }
.locked .ic { width: 18px; height: 18px; }
.bigclock { display: flex; justify-content: center; gap: 10px; }
.bigclock div { background: #1d180d; border: 1px solid var(--line); border-radius: 14px; padding: 10px 16px; display: flex; flex-direction: column; align-items: center; min-width: 74px; }
.bigclock b { font-size: 34px; color: var(--sun); line-height: 1; }
.meet { background: linear-gradient(135deg, #ff6f8f33, #fcdf4b22); border: 1px solid #ff9ec4; border-radius: 12px; padding: 10px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.question { margin: 0; font-size: 19px; line-height: 1.4; background: #1d180d; border-left: 4px solid #8fd0ff; padding: 12px 14px; border-radius: 8px; }
.answers { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .answers { grid-template-columns: 1fr; } }

/* Çizim */
.drawcanvas { width: 100%; aspect-ratio: 4 / 3; border-radius: 10px; touch-action: none; cursor: crosshair; background: #fffaf0; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.swatches .sw { width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 2px solid var(--line); }
.swatches .sw.sel, .swatches .size.sel { border-color: var(--sun); box-shadow: 0 0 0 2px var(--sun); }
.swatches .size { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; }
.swatches .size i { background: var(--ink); border-radius: 50%; display: block; }

/* Bakım ve rozetler */
.stat { display: grid; grid-template-columns: 56px 1fr 30px; gap: 8px; align-items: center; font-size: 14px; }
.meter { height: 10px; background: #2b2410; border-radius: 999px; overflow: hidden; }
.meter.big { height: 16px; }
.meter i { display: block; height: 100%; background: var(--sun); border-radius: 999px; transition: width .4s; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.badge { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 10px; border-radius: 14px; background: #1d180d; opacity: .6; }
.badge.ok { opacity: 1; border: 1px solid var(--line); }
.badge .medal { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: #3a3320; color: #1a1608; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .2); }
.badge:not(.ok) .medal { color: #6b6250; }
.badge small { font-size: 11px; }
.badge .meter { width: 100%; height: 6px; }

/* Oyunlar */
.xox { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: min(100%, 300px); align-self: center; }
.xox button { aspect-ratio: 1; font-size: 40px; font-weight: 700; padding: 0; }
.xox .x { color: #ff6f8f; } .xox .o { color: #8fd0ff; }
.xox .win { background: #3a3320; border-color: var(--sun); }
.mem { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: min(100%, 380px); align-self: center; }
.mem button { aspect-ratio: 1; padding: 0; display: grid; place-items: center; background: repeating-linear-gradient(45deg, #2b2410 0 6px, #221d13 6px 12px); color: #1a1608; }
.mem button.up { border-color: #fff6; }
.mem button .ic { width: 32px; height: 32px; margin: 0; }
.foos { width: 100%; aspect-ratio: 5 / 3; border-radius: 10px; touch-action: none; border: 6px solid #7a4426; }
.foos-score { font-size: 1.15em; font-weight: 800; margin: 0 0 6px; }
.foos-kick { min-width: 140px; font-size: 1.1em; touch-action: none; user-select: none; }

/* Dekor */
.shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.shopitem { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; font-size: 12px; }
.itemprev { width: 66px; height: 66px; image-rendering: pixelated; background: #2b2410; border-radius: 10px; }
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.theme { display: flex; flex-direction: column; gap: 4px; align-items: center; padding: 6px; font-size: 12px; }
.theme i { width: 100%; height: 34px; border-radius: 6px; display: block; }
input[type=color] { width: 44px; height: 34px; padding: 0; border: 2px solid var(--line); border-radius: 8px; background: none; }

/* Tarih seçici, alanlar */
.field { display: flex; flex-direction: column; gap: 4px; }
.field b { font-weight: 600; }
.datepick { display: flex; gap: 6px; }
select { font: inherit; background: var(--panel); color: var(--ink); border: 2px solid var(--line); border-radius: 8px; padding: 9px 8px; flex: 1; min-width: 0; }
select:focus { outline: none; border-color: var(--sun); }
.pic { position: absolute; object-fit: cover; pointer-events: none; image-rendering: auto; }
.rooms { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.rooms button { padding: 7px 4px; font-size: 13px; }
.rooms button.sel { background: var(--sun); color: #1a1608; border-color: var(--sun); }

/* Onay, hukuki metinler */
.footlinks { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; font-size: 12px; }
.footlinks a, .legal a, .checks a { color: var(--sun); }
.legalnote { max-width: 34ch; }
.checks { display: flex; flex-direction: column; gap: 10px; text-align: left; max-width: 420px; }
.checks label { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink); line-height: 1.4; }
.checks input { width: 20px; height: 20px; flex: none; margin-top: 1px; accent-color: var(--sun); }
.legal { line-height: 1.55; font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 14px; -webkit-user-select: text; user-select: text; }
.legal h4 { color: var(--sun); margin: 14px 0 4px; font-family: 'Pixelify Sans', monospace; font-size: 15px; }
.legal p, .legal ul { margin: 6px 0; }
.legal .muted { color: var(--dim); font-size: 12px; }
button.danger { background: #5a1a26; border-color: #ff4f7b; color: #ffd0da; }
button.link.danger { background: none; color: #ff8fab; }
#consent { overflow: auto; justify-content: flex-start; padding-top: max(24px, env(safe-area-inset-top)); }
#consent > :first-child { margin-top: auto; } #consent > :last-child { margin-bottom: auto; }
body.cinema .prompt { display: none; }

/* Marka ve tanıtım */
h1 .get { color: var(--moon); font-size: 1em; text-shadow: 0 0 14px rgba(252, 223, 75, .45); }
.pitch { max-width: 420px; text-align: left; color: var(--dim); font-size: 13px; line-height: 1.5; }
.pitch summary { cursor: pointer; text-align: center; color: var(--sun); list-style: none; }
.pitch summary::-webkit-details-marker { display: none; }
.pitch h2 { font-size: 16px; color: var(--ink); margin: 10px 0 6px; }
.pitch ul { padding-left: 18px; margin: 6px 0; }
.pitch li { margin: 3px 0; }
.pitch b { color: var(--ink); }
#gate { overflow: auto; justify-content: flex-start; }
#gate > :first-child { margin-top: auto; }
#gate > :last-child { margin-bottom: auto; }

/* Dil seçici */
.langpick { width: auto; flex: none; padding: 6px 10px; font-size: 14px; border-radius: 999px; background: rgba(21, 18, 11, .85); }
#langCorner { position: fixed; top: max(10px, env(safe-area-inset-top)); right: 12px; z-index: 25; }
.langrow { justify-content: center !important; }
#gate .row { width: min(100%, 340px); }
#gate .row input { flex: 1; min-width: 0; width: auto; }

/* Arapça: sağdan sola. Oyun sahnesi ve koordinatlı katmanlar soldan sağa kalır. */
html[dir=rtl] body, html[dir=rtl] button, html[dir=rtl] input, html[dir=rtl] textarea, html[dir=rtl] select { font-family: 'Tajawal', 'Pixelify Sans', sans-serif; }
html[dir=rtl] #stage, html[dir=rtl] #tvLayer, html[dir=rtl] .drawcanvas, html[dir=rtl] .foos, html[dir=rtl] #bar { direction: ltr; }
html[dir=rtl] #langCorner { right: auto; left: 12px; }
html[dir=rtl] .tile, html[dir=rtl] .hubtile, html[dir=rtl] .list .item, html[dir=rtl] .checks, html[dir=rtl] .pitch, html[dir=rtl] #sheetBody input, html[dir=rtl] #sheetBody textarea { text-align: right; }
html[dir=rtl] .hubtile { align-items: flex-start; }

/* Oda sohbeti */
.speech { position: absolute; transform: translate(-50%, -100%); max-width: 180px; background: #fff6e6; color: #26160f; border-radius: 10px; padding: 4px 8px; font-size: 12px; line-height: 1.3; box-shadow: 0 3px 8px rgba(0,0,0,.35); text-align: center; white-space: normal; word-break: break-word; z-index: 2; }
.speech::after { content: ''; position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%); border: 5px solid transparent; border-top-color: #fff6e6; border-bottom: 0; }
#bar .chatbtn { position: relative; }
#bar .chatbtn .dot { position: absolute; top: 7px; right: 7px; width: 9px; height: 9px; border-radius: 50%; background: #ff4f7b; box-shadow: 0 0 0 2px #15120b; }
.chatpanel { position: fixed; z-index: 8; left: 12px; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 70px); width: min(360px, calc(100vw - 24px)); height: min(440px, 55vh); display: flex; flex-direction: column; background: rgba(18, 15, 9, .94); border: 1px solid rgba(255,246,216,.14); border-radius: 18px; box-shadow: 0 12px 30px rgba(0,0,0,.5); backdrop-filter: blur(12px); overflow: hidden; }
html[dir=rtl] .chatpanel { left: auto; right: 12px; }
.chathead { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px 6px; }
.chathead b { color: var(--sun); }
.chathead .x { width: 32px; height: 32px; padding: 0; display: grid; place-items: center; border-radius: 50%; }
.chathead .x .ic { margin: 0; width: 18px; height: 18px; }
.chatlist { flex: 1; overflow-y: auto; padding: 4px 12px; display: flex; flex-direction: column; gap: 6px; -webkit-user-select: text; user-select: text; }
.msg { max-width: 82%; display: flex; flex-direction: column; gap: 2px; }
.msg p { margin: 0; padding: 7px 10px; border-radius: 14px; font-size: 14px; line-height: 1.35; white-space: pre-wrap; word-break: break-word; font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; }
.msg small { font-size: 10px; color: var(--dim); padding: 0 6px; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg.me p { background: var(--sun); color: #1a1608; border-bottom-right-radius: 4px; }
.msg.them p { background: #2b2410; color: var(--ink); border-bottom-left-radius: 4px; }
.quick { display: flex; gap: 4px; padding: 4px 10px; }
.quick button { padding: 2px 6px; font-size: 18px; background: none; border: 0; }
.chatform { display: flex; gap: 6px; padding: 8px 10px 10px; }
.chatform input { flex: 1; width: auto; text-align: start; min-width: 0; }
.chatform button { width: 44px; padding: 0; display: grid; place-items: center; }
.chatform button .ic { margin: 0; }
@media (max-width: 600px) { .chatpanel { left: 8px; right: 8px; width: auto; height: 46vh; bottom: calc(max(8px, env(safe-area-inset-bottom)) + 60px); } }
body.cinema .chatpanel { bottom: calc(max(10px, env(safe-area-inset-bottom)) + 110px); }

/* Evcil dostumuz */
.pethead { display: flex; gap: 12px; align-items: center; }
.petprev { width: 112px; height: 91px; image-rendering: pixelated; background: radial-gradient(circle, #2b2410, #15120b); border-radius: 14px; flex: none; }
.petacts button { flex: 1 1 auto; }
.opts button:disabled { opacity: .45; }
.check { display: flex !important; justify-content: flex-start !important; gap: 8px; align-items: center; }
.check input { width: 20px; height: 20px; accent-color: var(--sun); }

/* Paylaşım kartı */
.sharepreview { display: block; max-width: 100%; max-height: 52vh; margin: 0 auto; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.sharepreview:not([src]) { display: none; }

/* Vitrin (misafir) modu */
body.viewer #help { display: none; }
body.viewer #inviteChip { background: var(--sun); color: #1a1608; font-weight: 700; }

/* Dar ekranda 9 düğme sığsın */
@media (max-width: 420px) { #bar { gap: 2px; padding: 4px; } #bar button { width: 34px; height: 38px; border-radius: 11px; } #bar .sep { display: none; } .ic { width: 19px; height: 19px; } }
@media (max-width: 340px) { #bar button { width: 29px; height: 36px; border-radius: 9px; } #bar .ic { width: 17px; height: 17px; } }
