/* Movies2Watch Watch Parties / Watch Room */
.m2w-wp-page {
  padding: 32px 0 64px;
}
.m2w-wp-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, .65fr);
  gap: 18px;
}
.m2w-wp-panel {
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  background: #0d1727;
  box-shadow: 0 18px 50px rgba(0,0,0,.18);
}
.m2w-wp-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.m2w-wp-top h1 { margin: 0; color: #fff; font-size: 20px; font-weight: 800; }
.m2w-wp-top p { margin: 4px 0 0; color: #8fa0b5; font-size: 11px; }
.m2w-wp-badges { display: flex; gap: 7px; flex-wrap: wrap; }
.m2w-wp-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(62,138,250,.12);
  color: #e68b96;
  font-size: 10px;
  font-weight: 800;
}
.m2w-wp-player { position: relative; padding-bottom: 56.25%; background: #000; }
.m2w-wp-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.m2w-wp-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 13px 15px; border-top: 1px solid rgba(255,255,255,.07); }
.m2w-wp-actions button, .m2w-wp-actions a {
  display: inline-flex; align-items: center; gap: 7px; min-height: 37px; padding: 8px 11px;
  border: 1px solid rgba(255,255,255,.09); border-radius: 8px; background: #14233a;
  color: #dce8f8 !important; font-size: 11px; font-weight: 800; text-decoration: none; cursor: pointer;
}
.m2w-wp-actions .primary { border-color: #9b1a29; background: #9b1a29; color: #fff !important; }
.m2w-wp-actions .danger { margin-left: auto; border-color: rgba(230,80,90,.35); background: rgba(230,80,90,.12); color: #ff9299 !important; }
.m2w-wp-status { padding: 0 15px 13px; color: #8fa1b7; font-size: 10px; }
.m2w-wp-status.is-error { color: #ff9399; }
.m2w-wp-status.is-success { color: #8de0a6; }
.m2w-wp-chat { display: flex; flex-direction: column; min-height: 610px; max-height: calc(100vh - 150px); }
.m2w-wp-chat-head { padding: 16px 17px; border-bottom: 1px solid rgba(255,255,255,.07); }
.m2w-wp-chat-head h2 { margin: 0; color: #fff; font-size: 16px; font-weight: 800; }
.m2w-wp-chat-head p { margin: 4px 0 0; color: #7d8ca1; font-size: 10px; }
.m2w-wp-messages { flex: 1; overflow: auto; padding: 12px 14px; }
.m2w-wp-message { display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 9px; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.m2w-wp-message:last-child { border-bottom: 0; }
.m2w-wp-avatar { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg,#6f121d,#9b1a29); color: #fff; font-size: 11px; font-weight: 800; }
.m2w-wp-msg-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.m2w-wp-msg-head strong { color: #eaf2ff; font-size: 11px; }
.m2w-wp-msg-head time { margin-left: auto; color: #65768d; font-size: 9px; }
.m2w-wp-role { padding: 2px 5px; border-radius: 999px; background: rgba(62,138,250,.12); color: #e68b96; font-size: 8px; font-weight: 800; }
.m2w-wp-msg-body { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; color: #bdc9d8; font-size: 11px; line-height: 1.5; }
.m2w-wp-msg-delete { margin-top: 4px; padding: 0; border: 0; background: transparent; color: #728299; font-size: 9px; cursor: pointer; }
.m2w-wp-msg-delete:hover { color: #ff8e96; }
.m2w-wp-chat-empty { padding: 45px 15px; text-align: center; color: #75869c; font-size: 11px; }
.m2w-wp-composer { padding: 12px; border-top: 1px solid rgba(255,255,255,.07); }
.m2w-wp-composer textarea { width: 100%; min-height: 78px; padding: 10px 11px; resize: vertical; border: 1px solid rgba(255,255,255,.09); border-radius: 9px; background: #08111e; color: #eef5ff; font: inherit; font-size: 11px; outline: 0; }
.m2w-wp-composer textarea:focus { border-color: #9b1a29; box-shadow: 0 0 0 3px rgba(62,138,250,.1); }
.m2w-wp-composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.m2w-wp-composer-foot span { color: #718198; font-size: 9px; }
.m2w-wp-composer-foot button { padding: 8px 11px; border: 0; border-radius: 8px; background: #9b1a29; color: #fff; font-size: 10px; font-weight: 800; cursor: pointer; }
.m2w-wp-login { padding: 16px; text-align: center; color: #8c9cb1; font-size: 11px; }
.m2w-wp-login a { color: #7fb3ff !important; font-weight: 800; }
.m2w-wp-ended { padding: 16px; border-radius: 12px; background: rgba(230,80,90,.1); color: #c44952; text-align: center; }

/* Public watch party directory: the site uses a light page background. */
.m2w-wp-directory {
  min-height: 430px;
  padding: 34px 15px 72px;
  color: #17233a;
}
.m2w-wp-directory-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  padding: 22px 24px;
  border: 1px solid #e5eaf2;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(19,45,83,.06);
}
.m2w-wp-directory-head h1 { margin: 0; color: #16243a; font-size: 27px; line-height: 1.2; font-weight: 800; }
.m2w-wp-directory-head p { margin: 7px 0 0; color: #77879b; font-size: 13px; line-height: 1.45; }
.m2w-wp-directory .m2w-wp-badge {
  flex: 0 0 auto;
  padding: 8px 11px;
  border: 1px solid #dbe7fb;
  background: #eef5ff;
  color: #3e78d5;
  font-size: 10px;
}
.m2w-wp-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.m2w-wp-card {
  display: flex; gap: 12px; min-width: 0; padding: 12px; border: 1px solid #e4eaf2; border-radius: 13px;
  background: #fff; color: #17233a !important; text-decoration: none !important;
  box-shadow: 0 8px 24px rgba(20,55,96,.05); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.m2w-wp-card:hover { transform: translateY(-2px); border-color: #b9d0f4; background: #fff; box-shadow: 0 12px 28px rgba(20,55,96,.10); }
.m2w-wp-poster { width: 70px; height: 100px; flex: 0 0 70px; border-radius: 8px; object-fit: cover; background: #edf1f6; }
.m2w-wp-card-body { min-width: 0; }
.m2w-wp-card h2 { margin: 3px 0 5px; color: #17233a; font-size: 14px; line-height: 1.3; font-weight: 700; }
.m2w-wp-card p { margin: 0; color: #7a899c; font-size: 10px; line-height: 1.4; }
.m2w-wp-card-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.m2w-wp-card-meta span { padding: 4px 6px; border-radius: 6px; background: #eef5ff; color: #3e78d5; font-size: 9px; font-weight: 800; }
.m2w-wp-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  padding: 48px 20px;
  border: 1px dashed #ced8e6;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(20,55,96,.04);
  text-align: center;
  color: #7c8ca0;
  font-size: 13px;
}
.m2w-wp-empty i { display: block; margin-bottom: 12px; color: #4b82df; font-size: 30px; }

@media (max-width: 991px) {
  .m2w-wp-shell { grid-template-columns: 1fr; }
  .m2w-wp-chat { min-height: 480px; max-height: none; }
  .m2w-wp-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 575px) {
  .m2w-wp-page, .m2w-wp-directory { padding-top: 16px; }
  .m2w-wp-top { align-items: flex-start; flex-direction: column; }
  .m2w-wp-actions .danger { margin-left: 0; }
  .m2w-wp-directory-head { align-items: flex-start; flex-direction: column; padding: 18px; }
  .m2w-wp-directory-head h1 { font-size: 22px; }
  .m2w-wp-directory .m2w-wp-badge { white-space: normal; line-height: 1.35; }
  .m2w-wp-grid { grid-template-columns: 1fr; }
}

/* v2: Twitch-style theater mode keeps only the room player + party chat in view. */
.m2w-wp-theater-toggle {
  white-space: nowrap;
}
.m2w-wp-theater-toggle i {
  width: 12px;
  text-align: center;
}
body.m2w-wp-theater-mode {
  overflow: hidden !important;
  background: #060b12 !important;
}
body.m2w-wp-theater-mode .m2w-wp-page {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  width: 100vw !important;
  max-width: none !important;
  height: 100vh;
  margin: 0 !important;
  padding: 0 !important;
  background: #060b12;
}
body.m2w-wp-theater-mode .m2w-wp-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
}
body.m2w-wp-theater-mode .m2w-wp-panel {
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
body.m2w-wp-theater-mode .m2w-wp-main {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #000;
}
body.m2w-wp-theater-mode .m2w-wp-top,
body.m2w-wp-theater-mode .m2w-wp-status {
  display: none !important;
}
body.m2w-wp-theater-mode .m2w-wp-player {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  padding: 0;
}
body.m2w-wp-theater-mode .m2w-wp-player iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
body.m2w-wp-theater-mode .m2w-wp-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
}
body.m2w-wp-theater-mode .m2w-wp-actions > :not([data-theater-toggle]) {
  display: none !important;
}
body.m2w-wp-theater-mode .m2w-wp-actions [data-theater-toggle] {
  min-height: 34px;
  padding: 7px 10px;
  border-color: rgba(255,255,255,.18);
  background: rgba(8,17,30,.88);
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
  backdrop-filter: blur(8px);
}
body.m2w-wp-theater-mode .m2w-wp-chat {
  height: 100vh;
  min-height: 0;
  max-height: none;
  border-left: 1px solid rgba(255,255,255,.08);
}
body.m2w-wp-theater-mode .m2w-wp-messages {
  min-height: 0;
}

@media (max-width: 767px) {
  body.m2w-wp-theater-mode .m2w-wp-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 58vh) minmax(0, 42vh);
  }
  body.m2w-wp-theater-mode .m2w-wp-main,
  body.m2w-wp-theater-mode .m2w-wp-chat {
    height: 100%;
  }
  body.m2w-wp-theater-mode .m2w-wp-chat {
    border-top: 1px solid rgba(255,255,255,.08);
    border-left: 0;
  }
  body.m2w-wp-theater-mode .m2w-wp-chat-head {
    padding: 10px 12px;
  }
  body.m2w-wp-theater-mode .m2w-wp-chat-head p {
    display: none;
  }
  body.m2w-wp-theater-mode .m2w-wp-composer {
    padding: 8px;
  }
  body.m2w-wp-theater-mode .m2w-wp-composer textarea {
    min-height: 48px;
  }
}

/* v3: polish watch-party directory and fullscreen-with-chat mode. */
.m2w-wp-directory,
.m2w-wp-directory *,
.m2w-wp-page,
.m2w-wp-page * {
  box-sizing: border-box;
}
.m2w-wp-directory {
  padding-top: 34px;
}
.m2w-wp-directory-head {
  position: relative;
  overflow: hidden;
  min-height: 118px;
  padding: 25px 28px;
  border: 0;
  background: linear-gradient(135deg,#531019 0%,#9b1a29 100%);
  box-shadow: 0 14px 36px rgba(31,57,107,.18);
}
.m2w-wp-directory-head:after {
  content: '';
  position: absolute;
  right: -65px;
  top: -105px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  pointer-events: none;
}
.m2w-wp-directory-head > * {
  position: relative;
  z-index: 1;
}
.m2w-wp-directory-head h1 {
  color: #fff;
  font-size: 28px;
  letter-spacing: -.02em;
}
.m2w-wp-directory-head p {
  max-width: 650px;
  color: rgba(255,255,255,.74);
  font-size: 13px;
}
.m2w-wp-directory .m2w-wp-badge {
  position: relative;
  z-index: 1;
  max-width: 290px;
  padding: 9px 12px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.10);
  color: #fff;
  line-height: 1.35;
  text-align: left;
}
.m2w-wp-grid {
  align-items: stretch;
  gap: 16px;
}
.m2w-wp-card {
  min-height: 136px;
  padding: 14px;
  border-color: #e2e8f1;
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(31,58,96,.07);
}
.m2w-wp-card:hover {
  border-color: #a9c4ee;
  box-shadow: 0 14px 30px rgba(31,58,96,.12);
}
.m2w-wp-poster {
  width: 78px;
  height: 112px;
  flex-basis: 78px;
  border-radius: 9px;
}
.m2w-wp-card-body {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  justify-content: center;
}
.m2w-wp-card h2 {
  margin-top: 5px;
  font-size: 15px;
}
.m2w-wp-card-meta {
  margin-top: auto;
  padding-top: 10px;
}
.m2w-wp-empty {
  min-height: 250px;
  border-style: solid;
  border-color: #e2e8f1;
  background: #fff;
  box-shadow: 0 10px 28px rgba(31,58,96,.06);
}

/* Fullscreen + chat. This is activated by our own room control, not the iframe's player fullscreen. */
.m2w-wp-fullscreen-toggle {
  white-space: nowrap;
}
body.m2w-wp-theater-mode .m2w-wp-page,
.m2w-wp-page:fullscreen,
.m2w-wp-page:-webkit-full-screen {
  width: 100vw !important;
  max-width: none !important;
  height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #060b12 !important;
}
.m2w-wp-page:fullscreen .m2w-wp-shell,
.m2w-wp-page:-webkit-full-screen .m2w-wp-shell {
  width: 100%;
  height: 100%;
}
body.m2w-wp-theater-mode .m2w-wp-shell {
  grid-template-columns: minmax(0,1fr) clamp(330px,24vw,420px);
}
body.m2w-wp-theater-mode .m2w-wp-chat {
  background: #0d1727;
}
body.m2w-wp-theater-mode .m2w-wp-chat-head {
  flex: 0 0 auto;
}
body.m2w-wp-theater-mode .m2w-wp-composer,
body.m2w-wp-theater-mode .m2w-wp-login {
  flex: 0 0 auto;
}
body.m2w-wp-theater-mode .m2w-wp-actions [data-theater-toggle] {
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
}

@media (max-width: 767px) {
  .m2w-wp-directory {
    padding-top: 18px;
  }
  .m2w-wp-directory-head {
    min-height: 0;
    padding: 20px;
  }
  .m2w-wp-directory-head h1 {
    font-size: 23px;
  }
  .m2w-wp-directory .m2w-wp-badge {
    max-width: none;
  }
  body.m2w-wp-theater-mode .m2w-wp-shell {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0,56vh) minmax(0,44vh);
  }
}

/* Movies2Watch integration guards. */
.m2w-wp-page{max-width:1500px;margin:0 auto 45px!important}.m2w-wp-directory{max-width:1500px;margin:0 auto 45px!important}.m2w-wp-directory-head{background:linear-gradient(135deg,#531019 0%,#9b1a29 100%)!important}.m2w-wp-card-meta span,.m2w-wp-role{background:rgba(155,26,41,.12)!important;color:#b52a3a!important}.m2w-wp-actions .primary,.m2w-wp-composer button{background:#9b1a29!important}.m2w-wp-empty i{color:#9b1a29!important}
.m2w-wp-directory-kicker{display:block;margin:0 0 6px;color:#fff;font-size:10px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}.m2w-wp-empty strong{display:block;margin-bottom:6px;color:#1d2b40;font-size:15px}.m2w-wp-empty span{display:block;max-width:650px;line-height:1.5}
