
/* The Premium layout is normally intentionally narrow.
   Only the Arena gets the extra width needed for the sticky Lounge column. */
@media (min-width:981px){
  .is-premium .site-grid{
    grid-template-columns:minmax(0,1fr);
    max-width:1180px;
  }

  /* When the shared Premium Lounge is present, restore the desktop
     two-column layout: game/content left, Lounge right. */
  .is-premium .site-grid.has-squeeze-lounge{
    grid-template-columns:minmax(0,1fr) 350px;
    gap:24px;
    align-items:start;
  }

  .is-premium .site-grid.has-squeeze-lounge .main-content{
    min-width:0;
  }

  .is-premium .main-content,
  .is-premium .arena-page{
    width:100%;
    max-width:none;
  }
}

/* WordSqueezer Premium — Squeeze Lounge */
.arena-premium-layout{
  display:grid;
  grid-template-columns:minmax(0,1fr) 350px;
  gap:24px;
  align-items:start;
}
.arena-main-column{min-width:0}

.squeeze-lounge{
  position:relative;
  min-width:0;
}
.sl-panel{
  position:sticky;
  top:88px;
  height:min(720px,calc(100vh - 112px));
  min-height:520px;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  background:var(--paper,#fff);
  border:1px solid var(--line,#d9d9d9);
  border-radius:18px;
  box-shadow:0 14px 36px rgba(0,0,0,.08);
}
.sl-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  padding:18px 18px 14px;
  border-bottom:1px solid var(--line,#ddd);
}
.sl-header h2{
  margin:3px 0 3px;
  font-size:1.35rem;
  line-height:1.05;
}
.sl-header p{
  margin:0;
  color:var(--muted,#666);
  font-size:.76rem;
  font-weight:800;
}
.sl-close{
  display:none;
  width:38px;
  height:38px;
  flex:0 0 38px;
  border:1px solid var(--line,#ddd);
  border-radius:50%;
  background:#fff;
  color:#222;
  font:800 1.45rem/1 system-ui,sans-serif;
  cursor:pointer;
}
.sl-messages{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overscroll-behavior:contain;
  padding:14px 14px 4px;
  scroll-behavior:smooth;
}
.sl-loading,.sl-empty{
  padding:28px 12px;
  color:var(--muted,#666);
  text-align:center;
  font-size:.86rem;
  line-height:1.5;
}
.sl-message{
  display:grid;
  grid-template-columns:34px minmax(0,1fr);
  gap:9px;
  margin:0 0 14px;
}
.sl-message.is-me .sl-bubble{
  background:#fff7ef;
  border-color:#efb47f;
}
.sl-avatar{
  width:34px;
  height:34px;
  border-radius:50%;
  object-fit:contain;
  background:#f7f7f7;
  border:1px solid var(--line,#ddd);
}
.sl-message-main{min-width:0}
.sl-meta{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:8px;
  margin:0 2px 4px;
}
.sl-name{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:.76rem;
  font-weight:900;
}
.sl-time{
  flex:0 0 auto;
  color:var(--muted,#777);
  font-size:.64rem;
  font-weight:700;
}
.sl-bubble{
  padding:9px 11px;
  border:1px solid var(--line,#ddd);
  border-radius:12px 12px 12px 3px;
  background:#fff;
  font-size:.88rem;
  line-height:1.38;
  overflow-wrap:anywhere;
  white-space:pre-wrap;
}
.sl-notice{
  display:none;
  margin:0 14px 8px;
  padding:8px 10px;
  border-radius:9px;
  background:#fff4e8;
  border:1px solid #efc18f;
  color:#6b3a0e;
  font-size:.75rem;
  font-weight:800;
  line-height:1.35;
}
.sl-notice.show{display:block}
.sl-compose{
  flex:0 0 auto;
  padding:12px;
  border-top:1px solid var(--line,#ddd);
  background:#fff;
}
.sl-compose textarea{
  display:block;
  width:100%;
  min-height:66px;
  max-height:120px;
  resize:none;
  box-sizing:border-box;
  border:1px solid #aaa;
  border-radius:11px;
  padding:10px 11px;
  background:#fff;
  color:#181818;
  font:inherit;
  line-height:1.35;
}
.sl-compose textarea:focus{
  outline:2px solid rgba(232,117,36,.22);
  border-color:#e87524;
}
.sl-compose-bottom{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto;
  align-items:center;
  gap:8px;
  margin-top:8px;
}
#sl-rule{
  min-width:0;
  color:var(--muted,#777);
  font-size:.64rem;
  font-weight:700;
}
#sl-counter{
  color:var(--muted,#777);
  font-size:.66rem;
  font-weight:900;
  font-variant-numeric:tabular-nums;
}
#sl-counter.near{color:#b85c17}
#sl-counter.full{color:#b21f1f}
#sl-send{
  border:0;
  border-radius:9px;
  padding:9px 12px;
  background:#e87524;
  color:#fff;
  font-size:.72rem;
  font-weight:900;
  letter-spacing:.06em;
  cursor:pointer;
}
#sl-send:disabled{opacity:.48;cursor:not-allowed}

.sl-fab{display:none}

@media(max-width:980px){
  .arena-premium-layout{
    grid-template-columns:minmax(0,1fr) 320px;
    gap:18px;
  }
}

@media(max-width:980px){
  .arena-premium-layout{display:block}

  .squeeze-lounge{
    position:fixed;
    inset:0;
    z-index:1200;
    pointer-events:none;
    visibility:hidden;
  }
  .squeeze-lounge::before{
    content:"";
    position:absolute;
    inset:0;
    background:rgba(0,0,0,.28);
    opacity:0;
    transition:opacity 180ms ease;
  }
  .squeeze-lounge.is-open{
    pointer-events:auto;
    visibility:visible;
  }
  .squeeze-lounge.is-open::before{opacity:1}

  .sl-panel{
    position:absolute;
    left:8px;
    right:8px;
    bottom:0;
    top:auto;
    width:auto;
    height:min(82vh,760px);
    min-height:0;
    border-radius:20px 20px 0 0;
    transform:translateY(102%);
    transition:transform 220ms ease;
    box-shadow:0 -18px 44px rgba(0,0,0,.2);
  }
  .squeeze-lounge.is-open .sl-panel{transform:translateY(0)}
  .sl-close{display:inline-grid;place-items:center}
  .sl-header{padding:16px}
  .sl-messages{padding:13px 13px 3px}
  .sl-compose{padding:10px 10px max(10px,env(safe-area-inset-bottom))}
  .sl-compose textarea{min-height:58px}
  .sl-compose-bottom{grid-template-columns:minmax(0,1fr) auto auto}
  #sl-rule{font-size:.61rem}

  .sl-fab{
    position:fixed;
    right:18px;
    bottom:max(18px,env(safe-area-inset-bottom));
    z-index:1100;
    width:58px;
    height:58px;
    display:grid;
    place-items:center;
    border:0;
    border-radius:50%;
    background:#e87524;
    color:#fff;
    box-shadow:0 10px 24px rgba(0,0,0,.23);
    cursor:pointer;
  }
  .sl-fab svg{
    width:29px;
    height:29px;
    fill:none;
    stroke:currentColor;
    stroke-width:1.9;
    stroke-linejoin:round;
  }
  .sl-fab-badge{
    position:absolute;
    top:-4px;
    right:-4px;
    min-width:22px;
    height:22px;
    padding:0 5px;
    display:grid;
    place-items:center;
    border:2px solid #fff;
    border-radius:999px;
    background:#202020;
    color:#fff;
    font-size:.66rem;
    font-weight:900;
    box-sizing:border-box;
  }
  body.sl-lock{overflow:hidden}
}

@media(max-width:430px){
  .sl-panel{left:0;right:0;height:84vh}
  .sl-compose-bottom{
    grid-template-columns:1fr auto;
  }
  #sl-rule{grid-column:1 / -1}
}

@media(prefers-reduced-motion:reduce){
  .sl-panel,.squeeze-lounge::before{transition:none}
  .sl-messages{scroll-behavior:auto}
}
