/* Use dynamic viewport unit to avoid mobile browser chrome hiding content */
:root {
  --vh: 1vh;
}

#whiskas-game-container {
    height: calc(var(--vh, 1vh) * 100);
    padding-bottom: env(safe-area-inset-bottom);
}

/* Ensure inner content never overflows causing scroll */
.wcc-content {
    box-sizing: border-box;
    overflow: hidden;
}

/* Make sure interactive elements are reachable above dynamic browser UI */
.wcc-controls { position: relative; z-index: 30; }

/* If any element uses absolute bottom positioning, add safe area offset */
[data-wcc-bottom] { bottom: env(safe-area-inset-bottom); }



/* Responsive full-screen styles for Whiskas Cat Catch Game */
*{box-sizing:border-box}
html.wcc-game-active, body.wcc-game-active {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden !important; /* prevent page scrolling while game active */
    -webkit-overflow-scrolling: auto !important;
}

/* Game container: fill viewport without causing scrollbars */
#whiskas-game-container {
    position:fixed;
    inset:0;
    width:100vw;

    max-width: none;
    margin: 0;
    padding: 0;
    background-color: #f017e2;
    overflow: hidden;
    color: #fff;
    user-select: none;
    -webkit-user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ensure inner screens scale responsively */
.wcc-screen {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

/* Make content scale on very small screens while preserving layout */
.wcc-content {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* Responsive logo and images */
.wcc-logo img, #whiskas-game-container img {
    max-width: 220px;
    height: auto;
    /* display: block; */
    float: none;
    text-align: center;
}

/* Buttons and controls should wrap and be reachable */
.wcc-btn {
    width: min(320px, 90%);
    padding: 12px 16px;
    font-size: 18px;
    line-height: 1;
    border-radius: 8px;
    box-sizing: border-box;
}

/* Score and timer placed without overflowing */
#wcc-timer, #wcc-score {
    position: relative;
    display: inline-block;
    padding: 6px 10px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
	text-align:center;
}

/* Ensure any absolute-positioned game elements use vw/vh or percentage units */
.wcc-abs {
    position: absolute;
}

/* Small devices: slightly reduce large typography */
@media (max-height:560px), (max-width:360px) {
    .wcc-title { font-size: 20px; line-height: 1.1; }
    #wcc-timer #wcc-timer-val { font-size: 36px; height: 36px; line-height:36px; }
    .wcc-btn { font-size: 16px; padding:10px 12px; }
}


/* Original CSS (remaining rules) */
#whiskas-game-container {
    position: relative;
    width: 100%;
    max-width: 480px;
    aspect-ratio: 8 / 16;
    margin: 0 auto;
    background-color: #f017e2;
    overflow: hidden;
    color: #fff;
    user-select: none;
    -webkit-user-select: none;
    
}

.wcc-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

#wcc-game {
    display: block;
    /* Handled by JS */
    z-index: 5;
}

.wcc-content {
    text-align: center;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

#wcc-landing {
    background: url(/wp-content/uploads/frame-bg-1.jpg) no-repeat bottom center;
    background-size: cover;
}

#wcc-game {
    background: url(/wp-content/uploads/frame-bg-2.jpg) no-repeat bottom center;
    background-size: cover;
}

#wcc-results {
    background: url(/wp-content/uploads/frame-bg-3.jpg) no-repeat bottom center;
    background-size: cover;
}

.wcc-intro {
    width: 100%;
    display: inline-block;
}

.wcc-logo {
    width: 100%;
    display: inline-block;
}

.wcc-logo span {
	width: 100%;
    display: inline-block;
    text-align: center;
    float: none;
}

.wcc-logo span img {
    width: 100%;
    display: inline-block;
}

.wcc-title {
    font-size: 46px;
    font-weight: bold !important;
    margin: -20px 0 0 0;
    line-height: 1em;
    color: #fff !important;
    padding: 0 20px 20px;
}

.wcc-text {
    font-size: 26px;
    margin: 0;
    font-weight: 700;
    line-height: 1.5;
    padding:0 20px 20px;
}

.wcc-cat-preview {
    width: 100px;
    height: 100px;
    margin: 0 auto 30px;
    background-color: #ccc;
    /* Placeholder */
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.wcc-btn {
    background-color: #fff;
    color: #9e1c7f;
    border: none;
    padding: 20px 40px;
    font-size: 26px;
    font-weight: 800;
    border-radius: 55px;
    cursor: pointer;
    transition: transform 0.1s;
    line-height: 1em;
    margin: 0 0 70px 0;
}

.wcc-btn:active {
    transform: scale(0.95);
}

.wcc-btn:hover {
    background: #73145c;
    color: #fff;
}

/* Game HUD */
#wcc-hud {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px 0 0 0;
    box-sizing: border-box;
    display: inline-grid;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    z-index: 20;
}

/* Play Area */
#wcc-play-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Player (Cat) */
.wcc-cat {
    position: absolute;
    bottom: 50px;
    left: 50%;
    /* JS will update this */
    width:109px;
    height: 250px;
    background-color: #000;
    /* Fallback */
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transform: translateX(0);
    /* We'll set left directly */
}

/* Treats */
.wcc-treat {
    position: absolute;
    width: 50px;
    height: 50px;
    background-color: #ffcc00;
    /* Fallback */
    border-radius: 50%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

#wcc-timer {
    background: url(/wp-content/uploads/circle.png) no-repeat bottom center;
    background-size: cover;
    width: 100px;
    height: 100px;
    text-align: center;
    box-sizing: border-box;
    padding: 10px;
}

#wcc-timer #wcc-timer-val {
    font-size: 50px;
    line-height: 50px;
    height: 50px;
    display: inline-block;
}

#wcc-score {
    margin: 15px 0 0 0;
    font-size: 14px;
    font-weight: 400;
}



/* Safe area adjustments and ensure the container won't cause scrollbars */
#whiskas-game-container {
    padding-bottom: constant(safe-area-inset-bottom);
    padding-bottom: env(safe-area-inset-bottom);
    padding-top: constant(safe-area-inset-top);
    padding-top: env(safe-area-inset-top);
    box-sizing: border-box;
}

/* Force body/html to have full height for some themes */
html, body {
    height: 100%;
}

/* Prevent unintended overscroll on iOS */
body.wcc-game-active {
    -webkit-overflow-scrolling: auto !important;
    overscroll-behavior: none !important;
}
