/* last */

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

::selection {
  color: #000;
  background-color: #fff;
}

html {
  font-size: 10px;
  font-variant-ligatures: none;
}

body {
  background-color: #fff;
  color: #000;
  max-width: 100%;
  max-height: 100%;
  margin: 0 auto;
  font-family: "Space Mono", monospace;
  padding: 1rem;
  padding-bottom: 6rem;
}

#canvas {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  pointer-events: none;
  z-index: 2;
}

header {
  margin-top: 2.4rem;
  margin-bottom: 2.4rem;
  border-top: 5px solid #000;
  border-bottom: 5px solid #000;
  padding: 1rem 0;
}

header > div {
  justify-content: space-between;
  margin-top: 1rem;
}

header a {
  background-color: blue;
  color: #000;
  text-decoration: none;
  padding: 1rem;
  font-size: 2rem;
  font-weight: bold;
  display: inline-block;
  font-style: italic;
  border-radius: 3px;
  user-select: none;
}

#room-num {
  font-size: 1.6rem;
}

h1 {
  font-size: 7rem;
  text-transform: lowercase;
  display: inline-block;
  position: static;
  transform: none;
}

h1_side {
  font-size: 7rem;
  text-transform: lowercase;
  display: inline-block;
  position: absolute;
  transform: rotate(-270deg) translateX(-16%) translateY(44%);
  transform-origin: 0;
}

unused {
  transform: rotate(-90deg) translateX(-100%) translateY(-70%);
}

h1 sup {
  font-style: normal;
  font-weight: normal;
  font-size: 2rem;
  margin-left: 1rem;
  color: #fff;
}

h2 {
  font-size: 2.4rem;
  line-height: 1.8;
}

main {
  font-size: 1.7rem;
}

hr {
  margin: 4rem 0;
  border-bottom: 3px solid #fff;
}

p,
pre {
  margin-bottom: 2rem;
}

p a {
  color: white;
  text-underline-offset: 1px;
  text-decoration-thickness: 4px;
  text-decoration-color: blue;
  transition: text-decoration-thickness ease-out 0.2s;
}

p a:hover {
  text-decoration-color: #fff;
  text-decoration-thickness: 8px;
}

p em {
  font-style: normal;
  background-color: #fff;
  color: #000;
  padding: 0 1rem;
  animation: pulse 1s ease-in-out infinite alternate;
}

pre {
  font-family: "Space Mono", monospace;
  background-color: #222;
  padding: 1.8rem;
  font-size: 1.5rem;
  line-height: 2;
  overflow: auto;
}

.cursor {
  position: absolute;
  pointer-events: none;
}

.cursor {
  margin-left: -10px;
  margin-top: -2px;
}

.cursor.self p {
  color: #000;
  font-size: 2rem;
  padding: 0 0.5rem;
}

.cursor img {
  width: 34px;
  height: 46px;
  image-rendering: pixelated;
}

.cursor p {
  text-align: center;
  text-align: left;
  font-size: 1.2rem;
}

.chatp {
  display: block;
  font-size: 14px;
  word-wrap: break-word;
  overflow: hidden;
  max-height: 77.7em;
  line-height: 1.2em;
  text-align: justify;
  margin-top: 16px;
}
.chatbox {
  float: left;
  width: 80%;
  height: 45px;
  font-family: "Space Mono", monospace;
}
.chatbutton {
  float: right;
  width: 20%;
  height: 45px;
  font-family: "Space Mono", monospace;
}
.smallbutton {
  float: right;
  width: 13%;
  height: 45px;
  font-family: "Space Mono", monospace;
}
.bigbutton {
  float: right;
  width: 33%;
  height: 60px;
  font-family: "Space Mono", monospace;
}
.audiobox {
  float: right;
  width: 10%;
  height: 45px;
  font-family: "Space Mono", monospace;
}

.video-circle {
  border-radius: 50%;
  object-fit: cover;
  width: 120px;
  height: 120px;
  max-width: 250px;
  margin-left: -30%;
  margin-top: -18px;
}

.handgreen {
  filter: invert(48%) sepia(18%) saturate(3137%) hue-rotate(130deg)
    brightness(95%) contrast(80%);
}

.handgray {
  filter: invert(114%) sepia(45%) saturate(3139%) hue-rotate(170deg)
    brightness(95%) contrast(77%);
}
.handoff {
  opacity: 0.2;
}

.sider {
  float: right;
}
.splitleft {
  width: 70%;
  float: left;
}
.splitright {
  width: 30%;
  float: right;
}

.footer {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  text-align: center;
}

.iframe {
  border: 0;
  bottom: 10px;
  position: fixed;
  height: 50%;
  left: 0px;
}

@keyframes drop {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(10000%);
  }
}

@keyframes pulse {
  from {
    opacity: 0.4;
  }

  to {
    opacity: 1;
  }
}

@media (max-width: 820px) {
  html {
    font-size: 12px;
  }
  body {
    padding: 0;
    padding-bottom: 0;
    overflow: hidden;
  }
}

button:hover:disabled {
  background-color: #e2e8f0;
  pointer-events: none;
}
button:disabled {
  opacity: 0.5;
  pointer-events: none;
}

#call {
  max-width: 100rem;
}

#whiteboard {
  position: fixed;
  left: 0px;
  top: 0px;
  height: 100%;
  width: 100%;
  z-index: -10000;
}

.blinking {
  animation: blinkingText 1.2s infinite;
}
@keyframes blinkingText {
  0% {
    color: #000;
  }
  49% {
    color: #000;
  }
  60% {
    color: transparent;
  }
  99% {
    color: transparent;
  }
  100% {
    color: #000;
  }
}

/* circle list */

#list {
  background-color: transparent;
  height: 70%;
  width: 50%;
  top: 15%;
  left: 20%;
  border-radius: 50%;
  position: fixed;
}

.list-item {
  list-style: none;
  border-radius: 50%;
  border: 4px dotted #d2d2d2;
  height: 100px;
  width: 100px;
  position: absolute;
  top: 50%;
  left: 50%;
}

.list-text {
  text-align: center;
  top: 41%;
  position: relative;
}

.overtop {
  position: relative;
}

.sidenav {
  height: 100%;
  width: 0;
  position: fixed;
  z-index: 1;
  top: 0;
  left: 0;
  background-color: #a2a2a2;
  overflow-x: hidden;
  transition: 0.5s;
  padding-top: 60px;
}

.sidenav a {
  padding: 8px 8px 8px 32px;
  text-decoration: none;
  font-size: 15px;
  color: #ffffff;
  display: block;
  transition: 0.3s;
}

.sidenav a:hover {
  color: #f1f1f1;
}

.sidenav p {
  padding: 8px 8px 8px 32px;
  text-decoration: none;
  font-size: 15px;
  color: #ffffff;
  display: block;
  transition: 0.3s;
}

.sidenav .closebtn {
  position: absolute;
  top: 0;
  right: 25px;
  font-size: 36px;
  margin-left: 50px;
}

@media screen and (max-height: 450px) {
  .sidenav {padding-top: 15px;}
  .sidenav a {font-size: 16px;}
  .overtop { top: -70px; }
}

.favcolor{
  height: 30px;
  background: transparent;
  width: 40%;
}

/* --- new grid UI --- */

body {
  background: #0f0f0f;
  color: #d0d0d0;
  padding: 0;
  margin: 0;
  min-height: 100vh;
}

body.theme-light {
  background: #f4f4f4;
  color: #111;
}

#app-shell {
  min-height: 100vh;
  padding: 8px;
}

.grid-wrap {
  position: relative;
  min-height: calc(100vh - 16px);
}

.main-grid {
  display: grid;
  grid-template-rows:
    minmax(220px, var(--row-1, 60%))
    minmax(200px, var(--row-2, 40%));
  grid-template-columns: 1fr;
  height: calc(100vh - 16px);
  width: 100%;
}

.row-grid {
  display: grid;
  grid-template-columns:
    minmax(140px, var(--top-col-1, 25%))
    minmax(140px, var(--top-col-2, 25%))
    minmax(140px, var(--top-col-3, 25%))
    minmax(140px, var(--top-col-4, 25%));
  gap: 0;
  width: 100%;
}

.row-grid.row-bottom {
  grid-template-columns:
    minmax(140px, var(--bot-col-1, 25%))
    minmax(140px, var(--bot-col-2, 25%))
    minmax(140px, var(--bot-col-3, 25%))
    minmax(140px, var(--bot-col-4, 25%));
}

.mobile-shell {
  display: none;
}

.tile {
  position: relative;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0;
  border: 1px solid #111;
  color: #c9c9c9;
  min-height: 120px;
  overflow: hidden;
}

body.theme-light .tile {
  border-color: #d8d8d8;
  color: #222;
}

.mobile-menu {
  display: none;
  justify-content: flex-end;
  padding: 6px 8px;
  position: relative;
}

.mobile-menu-toggle {
  background: #1b1b1b;
  color: #e0e0e0;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 16px;
}

.mobile-menu-dropdown {
  display: none;
  position: absolute;
  right: 8px;
  top: 46px;
  background: #222;
  border: 1px solid #444;
  border-radius: 6px;
  padding: 6px;
  z-index: 20;
}

.mobile-menu-dropdown.open {
  display: block;
}

.collapse-handle {
  display: none;
  position: fixed;
  right: 12px;
  bottom: 12px;
  background: #2a2a2a;
  color: #f0f0f0;
  border: 1px solid #444;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  cursor: grab;
  z-index: 50;
  user-select: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.tile-head {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 0;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tile-title {
  font-size: 18px;
  letter-spacing: 1px;
}

.tile-meta {
  font-size: 12px;
  color: #b5b5b5;
}

body.theme-light .tile-title,
body.theme-light .tile-meta {
  color: #222;
}

.tile-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.tile-head:hover {
  background: rgba(255, 255, 255, 0.06);
}

body.theme-light .tile-head:hover {
  background: rgba(0, 0, 0, 0.05);
}

.tile-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
  padding: 16px;
}

.controls-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.pill-btn {
  background: #2b2b2b;
  border: 1px solid #3a3a3a;
  color: #eaeaea;
  padding: 10px 14px;
  border-radius: 26px;
  min-width: 48px;
  transition: background 0.2s ease;
}

.pill-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.pill-btn:hover {
  background: #444;
}

.ghost-btn {
  background: transparent;
  color: #cfcfcf;
  border: 1px solid #444;
  padding: 8px 12px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.ghost-btn:hover {
  background: #2e2e2e;
  border-color: #666;
}

body.theme-light .pill-btn {
  background: #eaeaea;
  border: 1px solid #cfcfcf;
  color: #111;
}

body.theme-light .ghost-btn {
  background: transparent;
  color: #222;
  border: 1px solid #bcbcbc;
}

body.theme-light .ghost-btn:hover {
  background: #f0f0f0;
  border-color: #9e9e9e;
}

.media-feed {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  grid-auto-rows: 1fr;
  gap: 12px;
  padding: 16px;
  min-height: 0;
}

.media-feed video {
  width: 100%;
  height: 100%;
  min-height: 160px;
  object-fit: cover;
  border-radius: 6px;
  background: #101010;
}

body.theme-light .media-feed video,
body.theme-light .video-frame {
  background: #ededed;
}

.video-frame {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  background: #101010;
  min-height: 200px;
  height: 100%;
}

.video-label {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.65);
  color: #f0f0f0;
  font-size: 12px;
  border-radius: 4px;
  z-index: 2;
  pointer-events: none;
  text-align: right;
}

.video-avatar {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a0a;
  padding: 18px;
  transition: transform 0.15s ease-out;
  transform-origin: center;
}

.video-avatar img {
  width: 70%;
  height: 70%;
  max-width: 180px;
  max-height: 180px;
  object-fit: contain;
  opacity: 0.85;
}

.screen-view {
  flex: 1;
  background: #1b1b1b;
  border-radius: 6px;
  padding: 16px;
  display: flex;
  min-height: 0;
}

body.theme-light .screen-view {
  background: #e0e0e0;
}

.screen-view video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0c0c0c;
  border-radius: 4px;
}

body.theme-light .screen-view video {
  background: #f5f5f5;
}

.chat-log {
  flex: 1;
  background: #050505;
  border-radius: 4px;
  padding: 16px;
  overflow-y: auto;
  min-height: 160px;
  border: 1px solid #141414;
  min-height: 0;
}

.chat-input-row {
  margin-top: 0;
  padding: 12px 16px 16px;
  display: flex;
  gap: 8px;
}

.chatbox {
  flex: 1;
  height: 45px;
  background: #0e0e0e;
  border: 1px solid #202020;
  color: #f0f0f0;
  padding: 0 12px;
  border-radius: 6px;
}

body.theme-light .chat-log {
  background: #fafafa;
  color: #111;
  border-color: #d6d6d6;
}

body.theme-light .chatbox {
  background: #f7f7f7;
  border: 1px solid #cfcfcf;
  color: #111;
}

.draw-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.draw-picker {
  display: flex;
  align-items: center;
  gap: 8px;
}

#draw-surface {
  position: relative;
  flex: 1;
  background: #f6f6f6;
  border-radius: 6px;
  border: 1px solid #141414;
  overflow: hidden;
  min-height: 0;
  margin: 0 16px 16px;
}

#whiteboard {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

body.theme-light #draw-surface {
  background: #f6f6f6;
  border-color: #cccccc;
}

.file-drop {
  flex: 1;
  background: #0b0b0b;
  border: 1px dashed #303030;
  border-radius: 6px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
  text-align: center;
  min-height: 0;
  margin: 0 16px 16px;
}

.file-drop .hint {
  color: #8a8a8a;
  font-size: 12px;
}

body.theme-light .file-drop {
  background: #f5f5f5;
  border-color: #cfcfcf;
  color: #111;
}

.settings-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.resize-layer {
  pointer-events: none;
  position: absolute;
  inset: 0;
}

.resize-handle {
  position: absolute;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: background 0.15s ease;
  pointer-events: auto;
  z-index: 5;
}

.resize-handle.col {
  top: 0;
  bottom: 0;
  width: 12px;
  cursor: col-resize;
  transform: translateX(-50%);
}

.resize-handle.row {
  left: 0;
  right: 0;
  height: 12px;
  cursor: row-resize;
  transform: translateY(-50%);
}

.resize-handle:hover {
  background: rgba(255, 255, 255, 0.2);
}

.list-ring {
  flex: 1;
  position: relative;
}

.tile.voice { background: #5c5c5c; }
.tile.video { background: #2d2d2d; }
.tile.screen { background: #343434; }
.tile.chat { background: #000; }
.tile.draw { background: #1e1e1e; }
.tile.file { background: #000; }
.tile.settings { background: #525252; }
.tile.spacer { background: transparent; border: 1px dashed #333; }

body.theme-light .tile.voice { background: #d3d3d3; }
body.theme-light .tile.video { background: #e8e8e8; }
body.theme-light .tile.screen { background: #cfcfcf; }
body.theme-light .tile.chat { background: #f7f7f7; }
body.theme-light .tile.draw { background: #dedede; }
body.theme-light .tile.file { background: #f3f3f3; }
body.theme-light .tile.settings { background: #d6d6d6; }
body.theme-light .tile.spacer { background: transparent; border-color: #cccccc; }
.who-body {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 16px;
  min-height: 0;
}
.who-logo {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 160px;
  max-width: 40%;
  height: auto;
  opacity: 0.95;
  display: block;
  pointer-events: none;
}

@media (max-width: 820px) {
  #app-shell {
    padding: 4px;
  }
  .grid-wrap {
    min-height: auto;
  }
  .main-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: auto;
    min-height: 100vh;
  }
  .mobile-menu,
  .mobile-shell {
    display: none;
  }
  .tile {
    min-height: 12vh;
    display: flex;
    transition: min-height 0.2s ease, transform 0.2s ease;
    order: var(--tile-order, 9);
    opacity: 0.9;
  }
  .tile.mobile-primary {
    min-height: 60vh;
    opacity: 1;
  }
  .tile.mobile-mini {
    min-height: 10vh;
    opacity: 0.85;
  }
  .resize-layer {
    display: block;
  }
  body.mobile-collapsed .main-grid,
  body.mobile-collapsed .mobile-shell,
  body.mobile-collapsed .resize-layer {
    display: none;
  }
  body.mobile-collapsed .collapse-handle {
    display: block;
  }
}

@media (max-width: 720px) {
  .mobile-tabs {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
  }
  .controls-row {
    flex-wrap: wrap;
  }
  .pill-btn, .ghost-btn {
    width: auto;
  }
}

/* YouTube Player Styles */
.youtube-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  padding: 16px;
  min-height: 0;
}

.youtube-input-row {
  display: flex;
  gap: 8px;
}

.youtube-input {
  flex: 1;
  height: 45px;
  background: #0e0e0e;
  border: 1px solid #202020;
  color: #f0f0f0;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 13px;
}

.youtube-input:focus {
  outline: none;
  border-color: #444;
}

.youtube-player-container {
  flex: 1;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#youtube-player {
  width: 100%;
  height: 100%;
  min-height: 200px;
}

/* SweetAlert2 grayscale styling */
.ctzn-modal {
  background: #1a1a1a !important;
  color: #e2e2e2 !important;
  border: 1px solid #2f2f2f;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  font-family: "Space Mono", monospace;
}
.ctzn-title {
  color: #f0f0f0;
  letter-spacing: 0.5px;
}
.ctzn-input {
  background: #0f0f0f !important;
  color: #f5f5f5 !important;
  border: 1px solid #3a3a3a !important;
  border-radius: 6px !important;
}
.ctzn-input:focus {
  border-color: #7a7a7a !important;
  box-shadow: none !important;
}
.ctzn-btn {
  background: #2b2b2b !important;
  color: #f3f3f3 !important;
  border: 1px solid #4a4a4a !important;
  border-radius: 6px !important;
  padding: 10px 16px !important;
  font-weight: 600 !important;
}
.ctzn-btn:hover {
  background: #3a3a3a !important;
  border-color: #666 !important;
}
