/* Møbee Multi - Game Styles */

/* Ensure no mystery gutters */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
    overscroll-behavior-x: none;
}
* { box-sizing: border-box; }

:root {
    --bg-color: #f0f4f8;
    --accent: #4a90e2;
    --text: #333;
    --success: #BFCA86;
    --error: #E6A07F;
    --card-border-color: #f7f9d2;
    --card-border-width: 7px;
    --hex-height: 50%;
    --hex-width: 43.33%;
    --spread-radius: 25.5%;
    --symbol-scale: 0.66;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100vh;
    height: -webkit-fill-available;
    height: 100svh;          /* iOS stable viewport */
    height: 100dvh;          /* modern browsers */
    margin: 0;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    overscroll-behavior: none;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    overflow: hidden;
}

/* touch-action only on touch devices to prevent zoom/pan */
@media (pointer: coarse) {
    body {
        touch-action: none;
    }
}

header {
    text-align: center;
    z-index: 50;
    margin-top: 10px;
    flex-shrink: 0;
    position: relative;
}

.logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 5px;
    padding: 0 20px;
}

.logo-img {
    max-width: 80vw;
    height: auto;
    max-height: 12vh;
    width: 400px;
    object-fit: contain;
    cursor: pointer;
}

.stats {
    font-size: 1.4rem;
    margin-top: 5px;
    margin-bottom: 15px;
    display: flex;
    gap: 30px;
    justify-content: center;
    font-weight: 600;
}

#board-container {
    flex: 1;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: visible;
    position: relative;
    min-height: 0;
    padding: 30px 0 80px 0; /* Top padding + space for fixed footer */
    box-sizing: border-box;
}

#game-board {
    position: relative;
    width: 600px;
    height: 600px;
    transform-origin: center center;
    z-index: 30;
    overflow: visible;
}

.card {
    position: absolute;
    width: var(--hex-width);
    height: var(--hex-height);
    background: transparent;
    transform: translate(-50%, -50%);
    transform-origin: center center;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
    -webkit-backface-visibility: hidden;
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
}

.card-symbol-sticker {
    position: absolute;
    bottom: 7.5%;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 5;
}

.card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: visible;
    pointer-events: none;
    -webkit-mask-image: none;
    mask-image: none;
}

.card-shape {
    fill: #ffffff;
    stroke: var(--card-border-color);
    stroke-width: var(--card-border-width);
    stroke-linejoin: round;
    transition: stroke 0.3s, fill 0.3s;
}

.card:nth-child(1) { top: calc(50% - var(--spread-radius)); left: 50%; }
.card:nth-child(2) { top: calc(50% + (var(--spread-radius) * 0.5)); left: calc(50% + (var(--spread-radius) * 0.866)); }
.card:nth-child(3) { top: calc(50% + (var(--spread-radius) * 0.5)); left: calc(50% - (var(--spread-radius) * 0.866)); }

.card:hover {
    z-index: 10;
    transform: translate(-50%, -50%) scale(1.05);
    filter: drop-shadow(0 0 10px rgba(74, 144, 226, 0.5));
}

.card.correct { z-index: 15; animation: pulse 0.5s; filter: drop-shadow(0 0 15px var(--success)); }
.card.correct .card-shape { stroke: var(--success); fill: #eafaf1; }
.card.wrong { z-index: 15; animation: shake 0.4s; filter: drop-shadow(0 0 15px var(--error)); }
.card.wrong .card-shape { stroke: var(--error); fill: #fcebe9; }

.symbol-container {
    position: absolute;
    width: calc(34% * var(--symbol-scale));
    aspect-ratio: 1 / 1;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
    overflow: visible;
    clip-path: none !important;
    -webkit-clip-path: none !important;
}

.symbol-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.2s;
    mix-blend-mode: normal;
    filter: drop-shadow(0 0 0.5px rgba(0, 0, 0, 0.6));
}

/* Gameplay PNG symbols */
.game-symbol {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    image-rendering: auto;
    filter: drop-shadow(0 0 0.5px rgba(0, 0, 0, 0.6));
}

/* Scale symbol sprites to fill container */
.symbol-sprite {
    transform: scale(1);
    transform-origin: center center;
}

.symbol-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (hover: hover) {
    .symbol-container:hover { z-index: 20; }
    .symbol-container:hover > div,
    .symbol-container:hover > img {
        transform: scale(1.3);
    }
}

.pos-0 { top: 50%; left: 50%; }
.pos-1 { top: 24%; left: 50%; }
.pos-2 { top: 37%; left: 73%; }
.pos-3 { top: 63%; left: 73%; }
.pos-4 { top: 76%; left: 50%; }
.pos-5 { top: 63%; left: 27%; }
.pos-6 { top: 37%; left: 27%; }

#message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255,255,255,0.98);
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    display: block; /* Visible by default for lobby */
    z-index: 100;
    border: 4px solid #BEC887;
    width: 80%;
    max-width: 400px;
    margin-top: 20px;
}

#message.lost {
    border-color: #E6A07F;
}

/* --- Unified Button System --- */
:root {
  --btn-radius: 18px;
  --btn-font: 1.05rem;
  --btn-pad-y: 14px;
  --btn-pad-x: 18px;
  --btn-maxw: 360px;

  --btn-green: #BEC887;   /* primary */
  --btn-blue:  #4a90e2;   /* secondary */
  --btn-text:  #ffffff;
}

/* Base button styling for both <button> and <a class="buy-btn"> */
button,
a.buy-btn,
button.buy-btn,
button.stay-btn,
a.stay-btn {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  border-radius: var(--btn-radius);
  padding: var(--btn-pad-y) var(--btn-pad-x);
  font-size: var(--btn-font);
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  color: var(--btn-text);
  cursor: pointer;
  display: block;
  width: 100%;
  max-width: var(--btn-maxw);
  margin: 14px auto 0 auto;
  transition: transform 0.08s ease, filter 0.15s ease;
  font-family: 'Poppins', sans-serif;
}

button:active,
a.buy-btn:active,
button.buy-btn:active,
button.stay-btn:active {
  transform: scale(0.98);
}

/* Default button = primary green */
button {
  background: var(--btn-green);
}

/* Secondary CTA = blue */
a.buy-btn,
button.buy-btn {
  background: var(--btn-blue);
}

/* Explicit primary green CTA */
button.stay-btn,
a.stay-btn {
  background: var(--btn-green);
}

/* Named button variants */
.btn-primary {
  background: var(--btn-green) !important;
}

.btn-secondary {
  background: var(--btn-blue) !important;
}

/* Inside modal button stacks: full width, no max-width, no extra margins */
.modal-actions button,
.modal-actions a.buy-btn,
.modal-actions button.buy-btn,
.modal-actions button.stay-btn {
  max-width: none;
  margin: 0;
}

/* Amazon button styling */
.amazon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  background: #232f3e;
  border-radius: var(--btn-radius);
  text-decoration: none;
  transition: opacity 0.2s;
  width: 100%;
  max-width: none;
  margin: 0;
}

.amazon-btn:hover {
  opacity: 0.85;
}

.modal-content .amazon-btn img {
  width: 60%;
  height: auto;
  max-width: 60%;
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.08); }
    100% { transform: translate(-50%, -50%) scale(1); }
}
@keyframes shake {
    0% { transform: translate(-50%, -50%) translateX(0); }
    25% { transform: translate(-50%, -50%) translateX(-5px); }
    50% { transform: translate(-50%, -50%) translateX(5px); }
    75% { transform: translate(-50%, -50%) translateX(-5px); }
    100% { transform: translate(-50%, -50%) translateX(0); }
}
@keyframes symbolPush {
    0% { transform: scale(1); }
    40% { transform: scale(0.7); }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); }
}
.symbol-match {
    animation: symbolPush 0.3s ease-out !important;
}
@keyframes countdownPulse {
    0% { transform: scale(0.8); opacity: 0.5; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(1); opacity: 0.9; }
}
.countdown-number {
    animation: countdownPulse 1s ease-out;
    font-size: 3rem;
    font-weight: 700;
    color: #BEC887;
}

@keyframes timerPause {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1.1); }
}
@keyframes timerResume {
    0% { transform: scale(1.1); }
    50% { transform: scale(1.15); color: #2ecc71; }
    100% { transform: scale(1); color: inherit; }
}
.timer-display {
    display: inline-block;
    transition: transform 0.3s ease;
    margin-left: 30px;
}
.timer-number {
    display: inline-block;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    min-width: 2ch;
    text-align: right;
}
.timer-display.paused {
    animation: timerPause 0.3s ease forwards;
}
.timer-display.resumed {
    animation: timerResume 0.3s ease forwards;
}

.footer-link {
    position: fixed;
    bottom: 20px;
    width: 100%;
    text-align: center;
    z-index: 50;
    pointer-events: all;
}

.footer-link a {
    color: #999;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 400;
    transition: color 0.2s, transform 0.2s;
    display: inline-block;
}

.footer-link a:hover {
    color: #4a90e2;
    transform: translateY(-2px);
}

.footer-tagline {
    font-size: 1rem;
    color: #666;
    margin: 0 0 4px 0;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    z-index: 200;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    max-width: 90%;
    width: min(350px, 90vw);
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 40px;
    height: 40px;
    margin: 0;
}

.close-btn:hover {
    color: #333;
}

.modal-content h2 {
    color: #333;
    margin-bottom: 10px;
    margin-top: 0;
}

.modal-content p {
    color: #666;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.modal-content img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    margin: 15px 0;
}

#carousel-image {
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    height: auto;
    object-fit: contain;
}

/* Shop modal: larger on desktop */
#shop-modal .modal-content {
    width: 480px;
    max-width: 90%;
    padding: 40px;
}

/* Keep the modal stack spacing consistent */
.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Avatar sprites */
.avatar-sprite {
    width: 32px;
    height: 32px;
    background-image: url('assets/mobee_sprite.svg');
    /* SVG is 841.89×595.28, cell is 43.61, so to make cell = 32px:
       background-width = 841.89 * (32 / 43.61) = 617.67px
       background-height = 595.28 * (32 / 43.61) = 436.65px */
    background-size: 617.67px 436.65px;
    background-repeat: no-repeat;
    display: inline-block;
    transition: transform 0.2s ease;
    border: 1px solid #BEC887;
    border-radius: 50%;
}

.avatar-sprite[onclick]:hover {
    transform: scale(1.5);
}

/* Avatar selection grid */
.avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(48px, 1fr));
    gap: 4px;
    justify-content: center;
    margin: 20px auto;
    max-height: 400px;
    overflow-y: auto;
    padding: 8px;
    max-width: 100%;
}

/* Responsive avatar grid for mobile */
@media (max-width: 700px) {
    .avatar-grid {
        grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
        gap: 6px;
        padding: 4px;
    }

    .avatar-option {
        width: 44px;
        height: 44px;
        background-size: 850px 600px;
    }
}

.avatar-option {
    width: 48px;
    height: 48px;
    background-image: url('assets/mobee_sprite.svg');
    /* SVG is 841.89×595.28, cell is 43.61, so to make cell = 48px:
       background-width = 841.89 * (48 / 43.61) = 925.57px
       background-height = 595.28 * (48 / 43.61) = 654.56px */
    background-size: 925.57px 654.56px;
    background-repeat: no-repeat;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.avatar-option:hover {
    border-color: #4a90e2;
}

.avatar-option.selected {
    border-color: #BEC887;
    box-shadow: 0 0 10px rgba(190, 200, 135, 0.5);
}

#avatar-modal .modal-content {
    width: min(700px, 92vw);
    max-width: 92vw;
}

.invite-modal-content {
    border: 4px solid #F9CE79;
    width: 80%;
    max-width: 400px;
}

@media (orientation: landscape) and (max-height: 500px) {
    .logo-img { max-height: 8vh; }
}

/* iPhone-specific: full-bleed layout */
@media (max-width: 430px) {
    /* Prevent horizontal bounce */
    html, body {
        overflow-x: hidden !important;
    }

    /* UI height variables for board sizing */
    :root {
        --ui-top: 120px;     /* header/controls above board */
        --ui-bottom: 24px;   /* footer space */
        --symbol-scale: 0.66;
    }

    /* Full-bleed board container */
    #board-container {
        width: 100vw !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Square board: use available height, allow full width */
    #game-board {
        --availH: calc(100svh - var(--ui-top) - var(--ui-bottom));
        width: min(100vw, var(--availH)) !important;
        height: min(100vw, var(--availH)) !important;
        margin: 0 auto !important;
        padding: 0 !important;
    }

    .stats { font-size: 1.05rem; gap: 16px; }
    .logo-img { max-height: 10svh; }
    .logo-container {
        padding-left: 12px;
        padding-right: 12px;
    }

    /* Hide footer (store link + version) on mobile */
    .footer-link { display: none; }
}

/* Lobby styles */
.lobby {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
}

/* Lobby hex cards - uses same layout as #game-board */
.lobby-cards {
    position: relative;
    width: 600px;
    height: 600px;
    margin: 0 auto;
    transform-origin: center center;
}

.lobby-card-content {
    position: absolute;
    top: 15%;
    left: 15%;
    width: 70%;
    height: 70%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    pointer-events: none;
}

img.lobby-card-icon {
    width: 45%;
    height: auto;
    object-fit: contain;
}

/* Play Solo card icon - smaller and transparent like gameplay sticker */
.lobby-card:nth-child(1) img.lobby-card-icon {
    width: 25%;
    filter: grayscale(100%) opacity(0.2);
}

/* Lobby card border colors: red, yellow, green */
.lobby-card:nth-child(1) .card-shape { stroke: #E6A07F; } /* Play Solo - red */
.lobby-card:nth-child(2) .card-shape { stroke: #F9CE79; } /* Get the Cards - yellow */
.lobby-card:nth-child(3) .card-shape { stroke: #BEC887; } /* Play with Friends - green */

/* Friends section card border colors: same as lobby */
.friends-card:nth-child(1) .card-shape { stroke: #E6A07F; } /* Room Code - red */
.friends-card:nth-child(2) .card-shape { stroke: #F9CE79; } /* Room Link - yellow */
.friends-card:nth-child(3) .card-shape { stroke: #BEC887; } /* Start Game - green */

.lobby-card-label {
    font-size: clamp(0.7rem, 2vw, 0.95rem);
    font-weight: 700;
    color: #333;
    text-align: center;
}

.lobby-row {
    margin: 18px 0;
}

.lobby-row .lobby-label {
    font-size: 1.3rem;
}

.lobby-code-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.lobby-code-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.lobby-code-input-wrap {
    position: relative;
    display: inline-block;
}

.lobby-code-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background: no-repeat center/contain;
    opacity: 0.6;
    pointer-events: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='9' y='9' width='13' height='13' rx='2' ry='2'/><path d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/></svg>");
}

.lobby-label {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 6px;
}

.lobby-code {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: var(--text);
}

.btn.btn-tertiary {
    background: #f0f0f0;
    color: #333;
    border: 2px solid #ddd;
}

#copy-room-link-btn {
    min-width: 120px;
    text-align: center;
}

.lobby-code-input {
    padding: 10px 12px;
    border: 2px solid #F9CE79;
    border-radius: 10px;
    font-size: 1.4rem;
    font-weight: 800;
    text-align: center;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    width: min(220px, 70vw);
    background: #fff;
    padding-right: 36px;
}

.lobby-link-input {
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    width: min(360px, 85vw);
    background: #fff;
    padding-right: 36px;
}

.lobby-link-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background: no-repeat center/contain;
    opacity: 0.6;
    cursor: pointer;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='9' y='9' width='13' height='13' rx='2' ry='2'/><path d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/></svg>");
}

.lobby-link-icon:hover {
    opacity: 1;
}

.lobby-players {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    min-height: 40px;
}

.lobby-hint {
    color: #666;
    margin-top: 10px;
    font-weight: 600;
}

/* Lobby hero carousel with overlay */
.lobby-hero-link {
    display: inline-block;
    position: relative;
    margin-top: 10px;
    text-decoration: none;
}

.lobby-carousel {
    width: 400px;
    max-width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 14px;
    display: block;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.lobby-hero-overlay {
    position: absolute;
    bottom: 14px;
    right: 14px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 10px 24px;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lobby-hero-overlay .overlay-text {
    font-weight: 700;
    font-size: 1.1rem;
}

.lobby-hero-overlay .overlay-url {
    font-size: 0.85rem;
    color: #666;
}

.lobby-hero-link:hover .lobby-hero-overlay {
    background: #fff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* Lobby action buttons */
.lobby-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}

.lobby-actions .btn {
    margin: 0;
    max-width: none;
    width: 100%;
}

@media (min-width: 500px) {
    .lobby-actions {
        flex-direction: row;
    }
}

/* Friends section hex cards */
.friends-card-content {
    position: absolute;
    top: 15%;
    left: 15%;
    width: 70%;
    height: 70%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    pointer-events: none;
}

.friends-card-label {
    font-size: clamp(0.7rem, 2vw, 0.95rem);
    font-weight: 700;
    color: #333;
    text-align: center;
}

.friends-input-wrap {
    position: relative;
    width: 90%;
    pointer-events: auto;
}

.friends-code-input,
.friends-link-input {
    width: 100%;
    padding: 8px 28px 8px 6px;
    border: 2px solid #F9CE79;
    border-radius: 8px;
    font-size: clamp(0.7rem, 1.8vw, 0.9rem);
    font-weight: 700;
    text-align: center;
    background: #fff;
}

.friends-code-input {
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.friends-link-input {
    cursor: pointer;
}

.friends-code-input:hover,
.friends-link-input:hover {
    border-color: #e5b85a;
    background: #fffef8;
}

.friends-code-input:focus,
.friends-link-input:focus {
    outline: none;
    border-color: #4a90e2;
    background: #f8fbff;
}

.friends-copy-icon {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background: no-repeat center/contain;
    opacity: 0.5;
    cursor: pointer;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='9' y='9' width='13' height='13' rx='2' ry='2'/><path d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/></svg>");
}

.friends-copy-icon:hover {
    opacity: 1;
}

.friends-players {
    display: flex;
    gap: 4px;
    justify-content: center;
    flex-wrap: wrap;
    min-height: 40px;
}

.friends-start-btn {
    background: var(--btn-green);
    color: var(--btn-text);
    border: none;
    border-radius: 12px;
    padding: 10px 16px;
    font-size: clamp(0.7rem, 1.8vw, 0.9rem);
    font-weight: 700;
    cursor: pointer;
    pointer-events: auto;
    width: 90%;
}

.friends-start-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.friends-waiting {
    font-size: clamp(0.7rem, 2vw, 0.95rem);
    color: #666;
    font-weight: 700;
    text-align: center;
}

.friends-card-hint {
    font-size: clamp(0.5rem, 1.3vw, 0.65rem);
    color: #888;
    text-align: center;
    margin-top: 2px;
}

.friends-invite-btn {
    background: #F9CE79;
    color: #333;
    border: none;
    border-radius: 12px;
    padding: 10px 16px;
    font-size: clamp(0.7rem, 1.8vw, 0.9rem);
    font-weight: 700;
    cursor: pointer;
    pointer-events: auto;
    margin-top: 4px;
    width: 90%;
}

.friends-invite-btn:hover {
    background: #e5b85a;
}

/* Avatar pop-in animation when new player joins */
@keyframes avatarPopIn {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); opacity: 1; }
}

.avatar-sprite.new-player {
    animation: avatarPopIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 12-symbol card preview */
.preview-hint {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.preview-hint p {
    margin: 5px 0;
    font-weight: 700;
    font-size: 1.1rem;
}

.preview-hint .preview-subtext {
    font-size: 0.9rem;
    font-weight: 400;
    color: #999;
}

.preview-hint .btn {
    margin-top: 15px;
}

/* Preview card border color */
.preview-card .card-shape {
    stroke: #fff4de;
}

/* 12-symbol card layout */
.card-12-symbols {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.card-12-symbols .center-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 5%;
    height: auto;
    filter: grayscale(100%) opacity(0.2);
}

.card-12-symbols .symbol-12 {
    position: absolute;
    width: 18%;
    height: auto;
    pointer-events: auto;
    cursor: pointer;
}

.card-12-symbols .symbol-12-img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.15s ease-out;
}

@media (hover: hover) {
    .card-12-symbols .symbol-12:hover {
        z-index: 20;
    }
    .card-12-symbols .symbol-12:hover .symbol-12-img {
        transform: scale(1.3);
    }
}

.card-12-symbols .symbol-12-img.symbol-clicked {
    transform: scale(1.5);
}

/* Symbol positions for 12-symbol card */
/* Inner cardinal (close to center) - 35% from center */
.card-12-symbols .symbol-12.pos-0-inner {
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(180deg);
}
.card-12-symbols .symbol-12.pos-90-inner {
    top: 50%;
    left: 68%;
    transform: translate(-50%, -50%) rotate(-90deg);
}
.card-12-symbols .symbol-12.pos-180-inner {
    top: 65%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(0deg);
}
.card-12-symbols .symbol-12.pos-270-inner {
    top: 50%;
    left: 32%;
    transform: translate(-50%, -50%) rotate(90deg);
}

/* Outer cardinal (further out) - 55% from center */
.card-12-symbols .symbol-12.pos-0-outer {
    top: 15%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(180deg);
}
.card-12-symbols .symbol-12.pos-90-outer {
    top: 50%;
    left: 85%;
    transform: translate(-50%, -50%) rotate(-90deg);
}
.card-12-symbols .symbol-12.pos-180-outer {
    top: 85%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(0deg);
}
.card-12-symbols .symbol-12.pos-270-outer {
    top: 50%;
    left: 15%;
    transform: translate(-50%, -50%) rotate(90deg);
}

/* Diagonal positions */
.card-12-symbols .symbol-12.pos-45 {
    top: 25%;
    left: 71.5%;
    transform: translate(-50%, -50%) rotate(-135deg);
}
.card-12-symbols .symbol-12.pos-135 {
    top: 75%;
    left: 71.5%;
    transform: translate(-50%, -50%) rotate(-45deg);
}
.card-12-symbols .symbol-12.pos-225 {
    top: 75%;
    left: 28.5%;
    transform: translate(-50%, -50%) rotate(45deg);
}
.card-12-symbols .symbol-12.pos-315 {
    top: 25%;
    left: 28.5%;
    transform: translate(-50%, -50%) rotate(135deg);
}
