:root {
  --bg: #050505;
  --panel: #111111;
  --surface: #222222;
  --text: #ffffff;
  --muted: #888888;
  --primary: #ffffff;
  --primary-text: #000000;
  --primary-hover: #dddddd;
  --danger: #aa0000;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.5);
  --shadow-md: 0 4px 8px rgba(0,0,0,0.8);
}

/* Global Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-radius: 0 !important; /* Sharp terminal edges */
  border: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
  outline: none !important;
  font-family: 'Courier New', Courier, monospace;
}


html, body {
    user-select: none;
  height: 100%;
  width: 100%;
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  color: var(--text);
  overflow: hidden;
  font-size: 12px;

  /* Add these two lines to enable the movement */
  animation: moveGrid 20s linear infinite;
}

@keyframes moveGrid {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 40px 40px;
  }
}

button { cursor: pointer; color: var(--text); transition: 0.2s ease; }
input, select, textarea { color: var(--text); }

/* Layout & Board - Full Screen */
#layout {
  width: 100vw;
  height: 100svh;
  display: flex;
  position: relative;
}

#board {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: transparent;
  padding: 4px;
  overflow: hidden;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(17, 17, 17, 0.9);
  border-bottom: 1px solid #333 !important;
  padding: 8px;
  margin-bottom: 4px;
  gap: 8px;
  flex-wrap: wrap;
}

#status-banner {
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  text-align: center;
  flex: 1 1 100%;
  order: -1;
  padding: 6px;
  background: var(--surface);
  color: var(--text);
  letter-spacing: 2px;
}

.btn {
  background: var(--surface);
  color: var(--text);
  padding: 8px 12px;
  font-size: 10px;
  text-transform: uppercase;
  font-weight: bold;
  flex: 1;
  text-align: center;
  white-space: nowrap;
  border: 1px solid #333 !important;


}
.btn:hover { background: #333; }

.btn.primary { background: var(--primary); color: var(--primary-text); border: none !important;}
.btn.primary:hover { background: var(--primary-hover); }

.btn.danger { background: var(--danger); border-color: #ff4444 !important;}
/* .btn.ghost { background: transparent; border-color: transparent !important; } */
.btn.ghost:hover { background: var(--surface); }

.ghost{
  background: var(--panel);
  border: 1px solid #333 !important;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.user-pill {
  display: flex;
  gap: 6px;
  background: var(--surface);
  border: 1px solid #333 !important;
  padding: 8px 10px;
  font-size: 10px;
  font-weight: bold;
}

/* Arena */
.arena {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 0;
  padding: 10px 0;
}

/* Bot Cards */
.bot-mini-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  padding: 4px;
  width: 100%;
    border: 1px solid rgba(255,255,255,0) !important;
}
.mini-card {
  width: 20px;
  height: 30px;
  background: var(--surface) url('../img/CardBackFaceBlueSmallPattern.png') center / cover no-repeat;
    border: 1px solid rgba(255,255,255,0) !important;
}

/* Center Play Area */
.middle-battlefield {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
  flex: 1;
}

.table-center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#active-suit {
  font-size: 16px;
  font-weight: bold;
  margin-top: 8px;
  height: 18px;
}


.card:hover, .draw-pile:hover { transform: translateY(-4px); }

.draw-pile {
  background: url('../img/CardBackFaceBlueSmallPattern.png') center / 100% 100% no-repeat;
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0) !important;
}

.card img.cardface { width: 100%; height: 100%; object-fit: cover;}
.locked { opacity: 0.3; pointer-events: none; }

/* Player Hand */
.card-area {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  max-height: 35svh;
  overflow-y: auto;
}

/* Log Drawer */
.log-wrap {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 100%;
  background: rgba(5, 5, 5, 0.95);
  backdrop-filter: blur(5px);
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition: transform 0.3s ease;
  z-index: 200;
  border-left: 1px solid #333 !important;
}
@media (min-width: 600px) {
  .log-wrap { width: 320px; }
  .topbar { flex-wrap: nowrap; }
  #status-banner { order: 0; flex: 0 1 auto; }
}
#layout.hide-log .log-wrap { transform: translateX(100%); pointer-events: none; }

.log-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--panel);
  padding: 12px;
  border-bottom: 1px solid #333 !important;
}
.log-title { font-weight: bold; font-size: 14px; letter-spacing: 1px; }

#full-log {
  flex: 1;
  width: 100%;
  background: transparent;
  color: var(--muted);
  padding: 12px;
  resize: none;
  font-size: 11px;
  line-height: 1.4;
}

/* Popups & Modals */
#combat-popup, #suit-picker {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: var(--panel); padding: 20px; width: 90vw; max-width: 320px;
  text-align: center; display: none; z-index: 500;
  border: 1px solid var(--danger) !important;
}
#combat-popup h2 { font-size: 16px; color: var(--danger); margin-bottom: 8px; letter-spacing: 1px;}

#suit-picker { border-color: #555 !important; }
#suit-picker h4 { font-size: 14px; margin-bottom: 16px !important; letter-spacing: 1px;}
.suit-btn-container { display: flex; justify-content: center; gap: 8px; }
#suit-picker button {
  background: var(--surface); padding: 16px !important; font-size: 24px !important; flex: 1;
  border: 1px solid #333 !important;
}
#suit-picker button:hover { background: #333; transform: scale(1.05); }

#message-modal, .multi-play-modal, #auth-overlay, #bet-modal, .withdraw-modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85);
  backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; padding: 12px; z-index: 1200;
}

.withdraw-modal{
  z-index: 100;
}

.message-box, .multi-play-box, .auth-box, .bet-box, .withdraw-modal-box {
  background: var(--panel); padding: 20px; width: 100%; max-width: 340px;
  display: flex; flex-direction: column; max-height: 95svh; overflow-y: auto;
  border: 1px solid #333 !important;
}
.multi-play-box { max-width: 500px; }

.modal-close { align-self: flex-end; background: var(--surface); padding: 6px 10px; font-weight: bold; margin-bottom: 12px; border: 1px solid #444 !important;}
.modal-close:hover { background: var(--danger); border-color: var(--danger) !important; }

.modal-title { font-size: 16px; font-weight: bold; margin-bottom: 16px; text-transform: uppercase; letter-spacing: 1px;}
.modal-kicker { font-size: 10px; color: var(--muted); margin-bottom: 4px; letter-spacing: 2px;}

/* Forms */
.form-group { display: flex; flex-direction: column; margin-bottom: 12px; gap: 6px; }
.form-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px;}
.form-input, .form-select, .form-textarea {
  background: var(--surface); padding: 10px; font-size: 14px; width: 100%;
  border: 1px solid #333 !important;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: #777 !important; }
.form-textarea { min-height: 80px; resize: vertical; }

/* Tabs & Grids */
.tabs-wrap { display: flex; gap: 4px; margin-bottom: 16px; }
.tab-btn { flex: 1; background: var(--surface); padding: 10px; font-size: 12px; text-transform: uppercase; border: 1px solid #333 !important;}
.tab-btn.active { background: var(--primary); color: var(--primary-text); }

.preset-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 16px; }
.preset-btn { background: var(--surface); padding: 10px 4px; font-size: 11px; border: 1px solid #333 !important;}
.preset-btn:hover { background: #444; }

.adjust-row { display: flex; gap: 6px; margin-bottom: 16px; }
.adjust-btn { background: var(--surface); padding: 0 20px; font-size: 18px; border: 1px solid #333 !important;}
.amount-display { flex: 1; text-align: center; font-weight: bold; font-size: 18px; }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 20px; }
.stat-box { background: var(--surface); padding: 10px 4px; text-align: center; border: 1px solid #333 !important;}
.stat-label { font-size: 9px; color: var(--muted); display: block; margin-bottom: 4px; letter-spacing: 1px;}
.stat-value { font-size: 14px; font-weight: bold; }

.action-row { display: flex; gap: 6px; }

/* Overlays */
#multi-tab-overlay {
  display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: #050505; z-index: 9999; flex-direction: column; justify-content: center;
  align-items: center; color: var(--danger); text-align: center; border: 2px solid var(--danger) !important;
}
#attack-laugh-overlay, #attack-sad-overlay {
  position:fixed; inset:0; z-index:2000; display:none; align-items:center; justify-content:center; background: rgba(0,0,0,0.8); pointer-events: none;
}
#attack-laugh-gif, #attack-sad-gif {
  width: clamp(100px, 50vw, 200px); background: transparent; padding: 4px;
}


/* Ensure the container has a set size */
.multi-play-card {
    width: 80px;  /* Adjust to your desired card width */
    height: 120px; /* Adjust to your desired card height */
    overflow: hidden;
    position: relative;
}

/* Force images to fill the container consistently */
.multi-play-card img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* This crops/scales images to fit without distortion */
}


/* Ensure the menu modal behaves like other modals */
#menu-modal {
    position: fixed; inset: 0; background: rgba(0,0,0,0.85);
    display: none; align-items: center; justify-content: center; z-index: 1200;
}

/* Optimize Topbar for mobile */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px;
    gap: 4px;
}

#status-banner {
    flex: 1;
    text-align: center;
    font-size: 12px;
    padding: 6px;
    background: var(--surface);
}


/* Update this in play.css */
.card, .draw-pile {
  /* Increased minimum size from 70px/100px to 90px/130px */
  width: clamp(90px, 25vw, 120px);
  height: clamp(130px, 35vw, 171px);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  flex: 0 0 auto;
  border: none !important;
}

/* Adjustments for the hand area */
.card-area {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px; /* Reduced gap to accommodate larger cards */
  padding: 8px;
  max-height: 40svh; /* Slightly increased to fit larger cards */
  overflow-y: auto;

}

.draw-pile {
  /* Restore the background image */
  background: url('../img/CardBackFaceBlueSmallPattern.png') center / 100% 100% no-repeat !important;
  /* Maintain the sizing and shadows */
  width: clamp(90px, 25vw, 120px);
  height: clamp(130px, 35vw, 171px);
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0) !important;
}

/* toast  */
.toast-container{
  z-index: 1000;
  background-color: rbga(0,0,0,.5);
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: row;
  justify-content: center;
  align-items: end;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: inherit;
  pointer-events: none;
}

.toast{
  width: auto;
  min-width: 100px;
  max-width: 400px
  height: auto;
  color: #fff;
  font-size: 14px;
  padding: 8px 24px;
  margin-bottom: 60px;
  font-family: inherit;
  background: var(--panel);
  border: 1px solid #333 !important;
}
