/* The door to a room (canvas "Davet ekranı"): someone opened an invite link or scanned a room's QR code. The hub draws
   it into #app on the home page (public/hub.js renderDoor): the invitation ticket with the room code, the name, and
   what happens next (joining, or why it did not work). On /ds/ds.css (buttons, fields, app icons). Its own class
   names (tk-, dr-) because landing.css is on the same page. The door is a container: from
   900 px of its own width the ticket goes left among the games and the form right. */

.door { container: door / inline-size; min-height: 100vh; }
.dr-wrap { display: flex; flex-direction: column; gap: 14px; min-height: 100vh; max-width: 480px; margin: 0 auto; padding: calc(12px + env(safe-area-inset-top)) 16px calc(22px + env(safe-area-inset-bottom)); }
.door a { color: var(--sun); text-decoration: none; font-weight: 900; }

/* top bar: the site and the language (the landing's flag menu) */
.dr-top { display: flex; align-items: center; justify-content: space-between; min-height: 48px; }
.door a.dr-logo { font-size: 22px; } /* the brand logo on one line (ds.css .brand) */

/* the ticket: a violet invitation, a yellow stub with the room code, a perforated line between them */
.tk { position: relative; margin: 10px 6px 0; filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.45)); transform: rotate(-2deg); animation: tkBob 5s ease-in-out infinite; }
.tk.still { animation: none; }
@keyframes tkBob { 0%, 100% { transform: rotate(-2deg) translateY(0); } 50% { transform: rotate(-1deg) translateY(-6px); } }
.tk-main {
  position: relative; padding: 18px 20px; border-radius: 24px 24px 0 0;
  background: radial-gradient(circle at 0 100%, transparent 13px, #33206f 13.5px) 0 0 / 51% 100% no-repeat, radial-gradient(circle at 100% 100%, transparent 13px, #33206f 13.5px) 100% 0 / 51% 100% no-repeat;
}
.tk-stub {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 18px; border-radius: 0 0 24px 24px; color: var(--on-light);
  background: radial-gradient(circle at 0 0, transparent 13px, var(--sun) 13.5px) 0 0 / 51% 100% no-repeat, radial-gradient(circle at 100% 0, transparent 13px, var(--sun) 13.5px) 100% 0 / 51% 100% no-repeat;
}
.tk-stub::before { content: ""; position: absolute; left: 20px; right: 20px; top: 0; border-top: 3px dashed rgba(27, 16, 51, 0.32); }
.tk-confetti { position: absolute; right: 14px; top: 10px; width: 120px; height: 70px; opacity: 0.9; }
.tk-confetti .c1 { fill: #ff6fae; } .tk-confetti .c2 { fill: #3fd0f0; } .tk-confetti .c3 { fill: #3ad38a; } .tk-confetti .c4 { fill: #ffd23f; }
.tk-confetti .c5 { fill: #ff9a52; } .tk-confetti .c6 { fill: #a596ff; } .tk-confetti .c7 { fill: #b8ec4a; }
.tk-k { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 1000; letter-spacing: 1.6px; text-transform: uppercase; color: var(--sun); }
.tk-star { width: 14px; height: 14px; fill: var(--sun); }
.tk-k span { margin-left: 6px; padding-left: 9px; border-left: 1px solid rgba(255, 255, 255, 0.25); color: var(--text-dim); letter-spacing: 0.4px; text-transform: none; font-weight: 900; }
.tk h1 { position: relative; margin-top: 10px; max-width: 250px; font-size: 28px; font-weight: 1000; line-height: 1.1; letter-spacing: -0.3px; }
.tk-guest { display: flex; align-items: flex-end; gap: 10px; margin-top: 14px; }
.tk-guest > span { padding-bottom: 5px; font-size: 12px; font-weight: 1000; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-dim); }
.tk-hand { flex: 1; min-width: 0; min-height: 36px; padding: 0 4px; border-bottom: 2px dotted rgba(255, 255, 255, 0.35); font-family: var(--font-hand); font-size: 34px; font-weight: 700; line-height: 1.05; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-hand:empty::after { content: ""; display: inline-block; width: 2px; height: 26px; margin-left: 2px; vertical-align: -4px; background: var(--sun); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.tk-l { font-size: 11px; font-weight: 1000; letter-spacing: 1.4px; text-transform: uppercase; color: rgba(27, 16, 51, 0.7); }
.tk-code { display: flex; gap: 8px; margin-top: 6px; }
.tk-code i { display: grid; place-items: center; width: 50px; height: 56px; border-radius: 12px; background: #fff; color: var(--on-light); font-style: normal; font-size: 32px; font-weight: 1000; line-height: 1; box-shadow: 0 4px 0 rgba(27, 16, 51, 0.3); }
.tk-code i:nth-child(odd) { transform: rotate(-3deg); }
.tk-code i:nth-child(even) { transform: rotate(2deg); }
.tk-admit { flex: none; width: 66px; height: 66px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 2.5px dashed rgba(27, 16, 51, 0.45); transform: rotate(10deg); font-size: 11px; font-weight: 1000; letter-spacing: 0.6px; text-transform: uppercase; line-height: 1.05; color: rgba(27, 16, 51, 0.75); }
.tk-admit b { font-size: 15px; letter-spacing: 0.2px; }
/* joining: the stub tears off along the dotted line */
/* the torn piece needs room: what is under the ticket moves down with it */
.tk { transition: margin-bottom 0.35s ease; }
.tk.tearing { animation: none; margin-bottom: 50px; }
.tk.tearing .tk-stub { transform-origin: 100% 0; animation: tear 0.7s ease-in forwards; }
@keyframes tear { to { transform: rotate(-7deg) translateY(16px); } }
/* a refusal: a stamp instead of the guest line */
.tk-stamp { position: relative; display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; padding: 7px 14px; border: 3.5px solid currentColor; border-radius: 12px; font-size: 22px; font-weight: 1000; letter-spacing: 1.5px; text-transform: uppercase; transform: rotate(-6deg); animation: stampIn 0.45s ease-out both; }
.tk-stamp .i { width: 22px; height: 22px; stroke-width: 2.8; }
.tk-stamp.red { color: #ff6b6b; }
.tk-stamp.sun { color: var(--sun); }
@keyframes stampIn { 0% { transform: rotate(-6deg) scale(1.7); opacity: 0; } 65% { transform: rotate(-6deg) scale(0.94); opacity: 1; } 100% { transform: rotate(-6deg) scale(1); opacity: 1; } }
.tk.faded .tk-code i { background: rgba(255, 255, 255, 0.55); color: rgba(27, 16, 51, 0.55); }
.tk.faded h1 { opacity: 0.55; }

/* the form */
.dr-lead { margin-top: 8px; font-size: 16px; font-weight: 700; line-height: 1.45; color: var(--text-body); }
.dr-form { display: flex; flex-direction: column; gap: 10px; }
.dr-form .input { min-height: 56px; padding: 14px 16px; font-size: 18px; font-weight: 900; }
.dr-form .input::placeholder { font-size: 17px; font-weight: 700; }
.dr-form .input:disabled { opacity: 0.6; }
.dr-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; }
.primary.dr-btn { min-height: 60px; border-radius: 18px; font-size: 20px; font-weight: 1000; }
.ghost.dr-btn { min-height: 54px; border-radius: 16px; font-size: 17px; }
.dr-btn .i { width: 22px; height: 22px; stroke-width: 2.8; }
.primary.dr-btn.busy { background: var(--sun-hi); box-shadow: 0 3px 0 var(--sun-edge); transform: translateY(3px); cursor: default; }
.dr-spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.dr-note { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 2px; font-size: 13.5px; font-weight: 800; color: var(--text-dim); text-align: center; }
.dr-note .i { width: 17px; height: 17px; color: #3ad38a; stroke-width: 3; }
.dr-games { display: flex; flex-direction: column; align-items: center; gap: 10px; min-height: 76px; margin-top: auto; padding-top: 18px; }
.dr-games p { font-size: 11.5px; font-weight: 1000; letter-spacing: 1.2px; text-transform: uppercase; color: var(--text-faint); }
.dr-fan { display: flex; justify-content: center; }
.dr-fan .ai { width: 42px; height: 42px; border-radius: 12px; margin: 0 -2px; box-shadow: 0 6px 12px rgba(0, 0, 0, 0.35), inset 0 -2px 0 rgba(0, 0, 0, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.4); }
.dr-fan .ai svg { width: 29px; height: 29px; }
.dr-fan .ai:nth-child(odd) { transform: rotate(-8deg) translateY(2px); }
.dr-fan .ai:nth-child(even) { transform: rotate(7deg) translateY(-3px); }
.dr-alt { text-align: center; font-size: 14px; font-weight: 800; color: var(--text-dim); }
.dr-alt button { padding: 4px 2px; border: 0; background: none; font: inherit; font-weight: 900; color: var(--sun); cursor: pointer; }

/* a phone that knows the name: straight in */
.dr-known { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 22px; text-align: center; }
.dr-av { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: #d6a8d8; color: var(--on-light); font-size: 26px; font-weight: 1000; box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08); }
.dr-as { font-size: 19px; font-weight: 800; color: var(--text-body); }
.dr-as b { color: #fff; font-weight: 1000; }
.dr-entering { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 99px; background: rgba(255, 255, 255, 0.07); font-size: 14px; font-weight: 900; color: var(--text-dim); }
.dr-entering .i { width: 16px; height: 16px; color: var(--sun); }

/* why it did not work, and the ways on */
.dr-msg { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.dr-msg h2 { font-size: 26px; font-weight: 1000; line-height: 1.15; }
.dr-msg p { font-size: 16px; font-weight: 700; line-height: 1.5; color: var(--text-body); }

/* the two halves: the ticket (with the games floating around it on a desktop), and everything else */
.dr-vis { position: relative; }
.dr-side { display: flex; flex-direction: column; gap: 14px; flex: 1; }
.dr-fl { display: none; }

@container door (min-width: 900px) {
  .dr-wrap { display: grid; grid-template-columns: 1.05fr 0.95fr; grid-template-rows: auto 1fr; column-gap: 70px; max-width: 1160px; padding: 14px 20px 60px; }
  .dr-top { grid-column: 1 / -1; min-height: 62px; }
  .door a.dr-logo { font-size: 26px; }
  .dr-vis { display: grid; place-items: center; align-self: center; min-height: 560px; }
  .dr-side { gap: 22px; align-self: center; max-width: 440px; }
  .tk { width: 470px; margin: 0; }
  .tk h1 { max-width: 300px; font-size: 36px; }
  .tk-main { padding: 24px 26px; }
  .tk-stub { padding: 20px 26px 24px; }
  .tk-code i { width: 62px; height: 70px; font-size: 40px; border-radius: 14px; }
  .tk-admit { width: 78px; height: 78px; font-size: 12px; }
  .tk-admit b { font-size: 17px; }
  .tk-confetti { width: 150px; height: 88px; }
  .dr-lead { margin: 0; font-size: 22px; font-weight: 800; color: var(--text-soft); }
  .dr-note { justify-content: flex-start; }
  .dr-alt { text-align: left; font-size: 15px; }
  .dr-games { display: none; }
  .dr-known, .dr-msg { margin-top: 0; }
  .dr-known { align-items: flex-start; text-align: left; }
  .dr-fl { display: block; position: absolute; }
  .dr-fl .ai { width: 62px; height: 62px; border-radius: 18px; animation: flt 6s ease-in-out infinite; }
  .dr-fl .ai svg { width: 42px; height: 42px; }
  .dr-fl:nth-child(1) { left: 20px; top: 50px; transform: rotate(-10deg); }
  .dr-fl:nth-child(2) { right: 40px; top: 30px; transform: rotate(8deg); }
  .dr-fl:nth-child(3) { left: -62px; top: 330px; transform: rotate(6deg); }
  .dr-fl:nth-child(4) { left: 255px; bottom: -24px; transform: rotate(-7deg); }
  .dr-fl:nth-child(5) { left: 60px; bottom: 30px; transform: rotate(-5deg); }
  .dr-fl:nth-child(6) { right: 50px; bottom: 10px; transform: rotate(9deg); }
  .dr-fl:nth-child(7) { left: 250px; top: 0; transform: rotate(4deg); }
  .dr-fl:nth-child(2) .ai { animation-delay: -1s; } .dr-fl:nth-child(3) .ai { animation-delay: -2s; } .dr-fl:nth-child(4) .ai { animation-delay: -3s; }
  .dr-fl:nth-child(5) .ai { animation-delay: -4s; } .dr-fl:nth-child(6) .ai { animation-delay: -5s; } .dr-fl:nth-child(7) .ai { animation-delay: -2.5s; }
}
@keyframes flt { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
